incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek" <>
Subject RE: implementation of Unary Traits
Date Fri, 27 Jun 2008 16:03:12 GMT

Sorry for top posting...

Yes, the __rw_is_convertible_impl<T,U>::_C_make should probably be changed to return
__rw_remove_cv<_TypeT>::type (probably with a typedef). We should probably add a case
for this in the 20.meta.rel.cpp test also.

I'm on vacation today otherwise I'd make the necessary changes myself.


-----Original Message-----
From: Martin Sebor on behalf of Martin Sebor
Sent: Thu 6/26/2008 10:12 PM
Subject: Re: implementation of Unary Traits
Eric Lemings wrote:
>> -----Original Message-----
>> From: Martin Sebor [] On Behalf Of Martin Sebor
>> Sent: Thursday, June 26, 2008 5:45 PM
>> To:
>> Subject: implementation of Unary Traits
>> The implementation of Unary Traits (e.g., is_void) uses explicit
>> specialization on all four combinations of cv-qualifiers for each
>> trait (plain, const, volatile, and const volatile). I'm wondering
>> if the alternative approach of stripping the qualifiers before
>> "dispatching" to just one explicit specialization has been
>> considered. The potential advantage of this approach is fewer
>> declarations, smaller translation units, and thus (presumably)
>> faster compilation.
> Though I'm using a relational (binary) type trait, I'm getting warnings
> because the cv-qualifiers are not being stripped.

A test case is always helpful:

#include <type_traits>

int main ()
     return !std::is_convertible<const int, int>::value;

Seems like is_convertible might need to strip top-level cv qualifiers
from the types. What do you think, Travis?


> 	gcc -c -I/work/stdcxx/branches/4.3.x/include/ansi -D_RWSTDDEBUG
> -pthread -I/work/stdcxx/branches/4.3.x/include
> -I/build/stdcxx-4.3.x-15D/include
> -I/work/stdcxx/branches/4.3.x/tests/include  -std=gnu++0x
> -D_RWSTD_EXT_CXX_0X -W -Wall -Wcast-qual -Winline -Wshadow
> -Wwrite-strings -Wno-long-long -Wcast-align
> /work/stdcxx/branches/4.3.x/tests/utilities/20.tuple.cnstr.cpp
> 	/work/stdcxx/branches/4.3.x/include/rw/_meta_rel.h: In
> instantiation of '__rw::__rw_is_convertible_impl<const int, int>':
> 	/work/stdcxx/branches/4.3.x/include/rw/_meta_rel.h:93:
> instantiated from '__rw::__rw_is_convertible_3<const int, int, false,
> false>'
> 	/work/stdcxx/branches/4.3.x/include/rw/_meta_rel.h:122:
> instantiated from '__rw::__rw_is_convertible_2<const int, int, false>'
> 	/work/stdcxx/branches/4.3.x/include/rw/_meta_rel.h:145:
> instantiated from '__rw::__rw_is_convertible_1<const int, int, false,
> false>'
> 	/work/stdcxx/branches/4.3.x/include/rw/_meta_rel.h:163:
> instantiated from '__rw::__rw_is_convertible<const int, int>'
> 	/work/stdcxx/branches/4.3.x/include/tuple:68:   instantiated
> from 'std::tuple<const int>::_C_is_compatible<int>'
> 	/work/stdcxx/branches/4.3.x/include/tuple:123:   instantiated
> from 'std::tuple<_Types>::tuple(_TypesU&& ...) [with _TypesU = int,
> _TypesT = const int]'
> /work/stdcxx/branches/4.3.x/tests/utilities/20.tuple.cnstr.cpp:103:
> instantiated from here
> 	/work/stdcxx/branches/4.3.x/include/rw/_meta_rel.h:77: warning:
> type qualifiers ignored on function return type
> Brad.

  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message