This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: is_void<const void>


Am 23. März 2012 15:01 schrieb Jonathan Wakely <jwakely.gcc@gmail.com>:
> From 3.9.3 [basic.type.qualifier] cv-qualified void types are distinct
> from void itself, and from 20.9.4.1 [meta.unary.cat] says is_void<T>
> is true if T is void, so by my reading is_void<const void> should be
> false, meaning we have a bug.
>
> Should we remove the remove_cv in the definition of std::is_void?
>
> It could be simplified to be just:
>
> template<typename T>
> struct is_void : __is_void_helper<T>
> { };

I would stay away from such a decision. With the same rationale one
should change is_floating_point to have the effect to reject:

#include <type_traits>
static_assert(std::is_floating_point<const double>::value, "");

and for the integer types similarly. There exists an open core issue about
why the cv variants are not mentioned here for int types (#251).

I tend to suggest open a library issue for these. I know from Howard
that the intention of is_void clearly should include all cv variants
(as well as for floating point types and integral types).

- Daniel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]