
Hello, On my VC 8.0 I've successfully rewrote "is_reference" implementation (from is_reference.hpp) http://www.boost.org/doc/html/boost_typetraits/reference.html#boost_typetrai... down to the following: //////////////////////////////////////////////////////////////////// // IMPLEMENTATION template <class T> struct _wrapper {}; template <class T> T& is_ref_fn(_wrapper<T>); char is_ref_fn(...); template <class T> struct _is_ref { static bool const value = sizeof is_ref_fn( _wrapper<T>()) == 1; }; // USAGE void main() { bool is_ref_false = _is_ref<int>::value; bool is_ref_true = _is_ref<int&>::value; } //////////////////////////////////////////////////////////////////// I understand original code - but it uses "is_reference_helper1" and "is_reference_helper2" for the same thing - ie to distingwish between fn pointer size and char size but this could be done in "one pass" (see my is_ref_fn(..) above) also why to compare against fn ptr type and char type when we can compare against 'T' type reference (sizeof(T&) >= 4) and char (sizeof(char) == 1) (see my code) Is it just because on some platforms sizeof(char) != 1 ? If yes we can change 'char' to object with size >= sizeof(T&) to avoid this. Please comment on this. Thanks, Dmitry