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: type_traits progress
Date Mon, 02 Jun 2008 23:05:24 GMT
 

Martin Sebor worte:
>
>Eric Lemings wrote:
>>  
>> 
>> Martin Sebor wrote:
>>>
>>> Eric Lemings wrote:
>>>>  
>>>>
>>>>>>
>>>>>>> template <class T, T v>
>>>>>>> struct __rw_integral_constant
>>>>>>> {
>>>>>>>   static const T value = v;
>>>>>>>   typedef T value_type;
>>>>>>>   typedef integral_constant<T,v> type;
>>>>>>> }
>>>>
>>>> In all cases I've seen, `type' refers to type of self for identity
>>>> properties.  This typedef would not hold up the identity property.
>>> IIUC, for every specialization X of integral_constant, this
>>> must hold:
>>>
>>>    is_same<X, typename X::type>::value == true
>>>
>>> With integral_constant derived from __rw_integral_constant
>>> the condition would fail.
>> 
>> Not if it defined its own `type'.
>> 
>> 	template <class T, T v>
>> 	struct integral_constant: __rw_integral_constant<T, v>
>> 	{
>> 	  typedef integral_constant<T, v> type;
>> 	};
>
>Good point! This would effectively break the problematic dependency,
>wouldn't it, Travis?
>

Yes, it does allow us to use the name 'type' in both contexts.

>Martin
>

Mime
View raw message