incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek" <Travis.Vi...@roguewave.com>
Subject RE: remove_reference
Date Thu, 12 Jun 2008 21:18:59 GMT
 

Eric Lemings wrote:
> 
>Hmm.  So what's the benefit in providing internal type traits
>at all?  Seems to me that they only serve to slow down compile
>times.  Why not just break the public type traits into internal
>headers and include them all from the <type_traits> header?
>Or do we have some plans for the internal type traits that I'm
>unaware of?
>

It is my understanding that the internal traits exist to avoid namespace
pollution. Say we wanted to optimize std::uninitialized_fill<> for pod
types. If we used std::is_pod<>, then the user would be able to use that
type and possibly others without including <type_traits>.

Honestly, I don't see this as a great benefit, but it is something that
has been important to the implementation in the past.

As for the argument of slowing down compile times, there has been some
bickering about this in the past; should we put comments in the headers
or should we be splitting up large headers into multiple small ones and
should we coalesce multiple headers into one. I don't buy it unless
someone has a reasonable testcase as evidence. 

Travis

>Brad.
>
>
>
>> -----Original Message-----
>> From: Travis Vitek 
>> Sent: Thursday, June 12, 2008 11:51 AM
>> To: Eric Lemings
>> Subject: RE: remove_reference
>> 
>> 
>> Yes, and the internal ones don't inherit from 
>> integral_constant<T,V>, they inherit from 
>> __rw_integral_constant<T,V> [where applicable]
>> 
>> Travis
>> 
>> >-----Original Message-----
>> >From: Eric Lemings 
>> >Sent: Thursday, June 12, 2008 10:48 AM
>> >To: Travis Vitek
>> >Subject: RE: remove_reference
>> >
>> > 
>> >So the only key difference is that they -- the internal type
>> >traits -- can be included by group rather than the whole?
>> >
>> >Brad.
>> >
>> >> -----Original Message-----
>> >> From: Travis Vitek 
>> >> Sent: Thursday, June 12, 2008 11:33 AM
>> >> To: Eric Lemings
>> >> Subject: RE: remove_reference
>> >> 
>> >> 
>> >> They are intended to be exactly the same. They are used by 
>> >> the implementation of the public traits. 
>> >> 
>> >> >-----Original Message-----
>> >> >From: Eric Lemings 
>> >> >Sent: Thursday, June 12, 2008 10:27 AM
>> >> >To: Travis Vitek
>> >> >Subject: RE: remove_reference
>> >> >
>> >> > 
>> >> >Anything especially that I need to be aware of when using the
>> >> >internal type traits?  Or are they virtually the same as the
>> >> >public type traits?
>> >> >
>> >> >Brad.
>> >> >
>> >> >> -----Original Message-----
>> >> >> From: Travis Vitek 
>> >> >> Sent: Thursday, June 12, 2008 10:59 AM
>> >> >> To: Eric Lemings
>> >> >> Subject: RE: remove_reference
>> >> >> 
>> >> >> 
>> >> >> If you wanted std::remove_reference, you'd have to include 
>> >> >> <type_traits>. That is where all of the standard traits are

>> >> >> defined. If you want the internal trait 
>> >> >> _RW::__rw_remove_reference, you could still include 
>> >> >> <type_traits> if you wanted, or you could include 
>> ><rw/_meta_ref.h>.
>> >> >> 
>> >> >> I decided to break them down by their section in the 
>> >> >> standard. The remove_reference template is actually in 
>> >> >> meta.trans.ref, but that name would have been too long. I 
>> >> >> plan on submitting sometime this afternoon. I need to verify 
>> >> >> everything on gcc 4.3 again and that should be it.
>> >> >> 
>> >> >> Travis
>> >> >> 
>> >> >> >-----Original Message-----
>> >> >> >From: Eric Lemings 
>> >> >> >Sent: Thursday, June 12, 2008 9:12 AM
>> >> >> >To: Travis Vitek
>> >> >> >Subject: remove_reference
>> >> >> >
>> >> >> >Travis,
>> >> >> > 
>> >> >> >Based on your latest version, which header would I include
if 
>> >> >> >I just wanted the std::remove_reference type modifier?
>> >> >> > 
>> >> >> >Brad.
>> >> >> > 
>> >> >> >

Mime
View raw message