
28 Feb
2006
28 Feb
'06
1:56 p.m.
Unless that is not what you are referring to, in which case I really do need educating!
Adding a cv-qualifier to a reference type has no effect: typedef int& ref; typdef const ref cref; here ref and cref are actually the same type. The bug in Borland's compiler is that the above produces "int&const" for cref which is *not* a legal type in the C++ type system and is distinct from "const int&". This is in contrast to pointers, where "int*const" is a legal type (and distinct from "int const*"). So: add_const<add_reference<int>::type>::type is "int&" add_reference<add_const<int>::type::type is "const int &" John.