
17 Apr
2007
17 Apr
'07
9:04 a.m.
Grégory Pakosz wrote:
Hello,
I'm currently having a look at boost's type traits implementation. At the moment, I'm curious about is_enum. Can please someone explain me why add_reference is applied before testing convertibility to int_convertible ???
The class needs to declare an object of type T, and then try and see if it converts or not... but you may not be able to declare an object of type T (for example T may be abstract), where as you an always declare a reference to T, and the conversion rules work the same. HTH, John.