Topic: Interest in Constexpr Variable Templates Type Ttraits
Author: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Date: Sat, 23 Mar 2013 11:40:46 +0100
Raw View
This is a multi-part message in MIME format.
--------------050401020400010706040608
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hi,
N3546 TransformationTraits Redux propose some template alias for the
type traits getting a type.
If N3615 Constexpr Variable Templates is accepted is there an interest
to add the type traits value transformations counterpart, e.g.
template <typename T>
constexpr bool is_arithmetic_v = is_arithmetic<T>::value;
usage
is_arithmetic_v<T>
Note: the suffix _v stands for value to follow the suffix _t proposed in
N3546 that stands for type.
An alternative could be to use CamelCase for these traits.
template <typename T>
constexpr bool IsArithmetic = is_arithmetic<T>::value;
Best,
Vicente
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
--------------050401020400010706040608
Content-Type: text/html; charset=ISO-8859-1
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
N3546
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
TransformationTraits Redux propose some template alias for the type
traits getting a type.<br>
If N3615 Constexpr Variable Templates is accepted is there an
interest to add the type traits value transformations counterpart,
e.g.<br>
<br>
template <typename T><br>
constexpr bool is_arithmetic_v = is_arithmetic<T>::value;<br>
<br>
usage<br>
<br>
is_arithmetic_v<T><br>
<br>
Note: the suffix _v stands for value to follow the suffix _t
proposed in N3546 that stands for type.<br>
<br>
An alternative could be to use CamelCase for these traits.<br>
<br>
template <typename T><br>
constexpr bool IsArithmetic = is_arithmetic<T>::value;<br>
<br>
Best,<br>
Vicente<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
</body>
</html>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en">http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en</a>.<br />
<br />
<br />
--------------050401020400010706040608--
.
Author: Anthony Williams <anthony.ajw@gmail.com>
Date: Sat, 23 Mar 2013 11:38:46 +0000
Raw View
On 23/03/13 10:40, Vicente J. Botet Escriba wrote:
> Hi,
>
> N3546 TransformationTraits Redux propose some template alias for the
> type traits getting a type.
> If N3615 Constexpr Variable Templates is accepted is there an interest
> to add the type traits value transformations counterpart, e.g.
>
> template <typename T>
> constexpr bool is_arithmetic_v = is_arithmetic<T>::value;
>
> usage
>
> is_arithmetic_v<T>
>
> Note: the suffix _v stands for value to follow the suffix _t proposed in
> N3546 that stands for type.
>
> An alternative could be to use CamelCase for these traits.
>
> template <typename T>
> constexpr bool IsArithmetic = is_arithmetic<T>::value;
How is that an improvement over
template<typename T>
constexpr inline bool is_arithmetic_v(){
return is_arithmetic<T>::value;
}
usage:
is_arithmetic_v<T>()
?
Anthony
--
Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/
just::thread C++11 thread library http://www.stdthread.co.uk
Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
.
Author: W Brown <webrown.cpp@gmail.com>
Date: Sat, 23 Mar 2013 07:59:52 -0500
Raw View
On Mar 23, 2013, at 6:38 AM, Anthony Williams wrote:
> On 23/03/13 10:40, Vicente J. Botet Escriba wrote:
>>
>> N3546 TransformationTraits Redux propose some template alias for the
>> type traits getting a type.
>> If N3615 Constexpr Variable Templates is accepted is there an interest
>> to add the type traits value transformations counterpart, e.g.
>>
>> template <typename T>
>> constexpr bool is_arithmetic_v = is_arithmetic<T>::value;
>>
>> usage
>>
>> is_arithmetic_v<T>
>>
>> Note: the suffix _v stands for value to follow the suffix _t proposed in
>> N3546 that stands for type.
>>
>> An alternative could be to use CamelCase for these traits.
>>
>> template <typename T>
>> constexpr bool IsArithmetic = is_arithmetic<T>::value;
>
> How is that an improvement over
>
> template<typename T>
> constexpr inline bool is_arithmetic_v(){
> return is_arithmetic<T>::value;
> }
>
> usage:
>
> is_arithmetic_v<T>()
>
> ?
This is the topic of both N3552 and N3615 in the current mailing. N1785 (written in 2004/2005) is an early version. Best,
-- WEB
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
.
Author: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Date: Sat, 23 Mar 2013 17:03:55 +0100
Raw View
Le 23/03/13 12:38, Anthony Williams a =E9crit :
> On 23/03/13 10:40, Vicente J. Botet Escriba wrote:
>> Hi,
>>
>> N3546 TransformationTraits Redux propose some template alias for the
>> type traits getting a type.
>> If N3615 Constexpr Variable Templates is accepted is there an interest
>> to add the type traits value transformations counterpart, e.g.
>>
>> template <typename T>
>> constexpr bool is_arithmetic_v =3D is_arithmetic<T>::value;
>>
>> usage
>>
>> is_arithmetic_v<T>
>>
>> Note: the suffix _v stands for value to follow the suffix _t proposed in
>> N3546 that stands for type.
>>
>> An alternative could be to use CamelCase for these traits.
>>
>> template <typename T>
>> constexpr bool IsArithmetic =3D is_arithmetic<T>::value;
> How is that an improvement over
>
> template<typename T>
> constexpr inline bool is_arithmetic_v(){
> return is_arithmetic<T>::value;
> }
>
> usage:
>
> is_arithmetic_v<T>()
>
> ?
>
Clearly it is not a major improvement, but the user will not use () and=20
the definition contains no return, no inline keywords.
Nevertheless, my concern was, if N3615 is accepted, could we consider=20
this kind of extensions to the standard library.
Vicente
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/?hl=3Den.
.