A few years ago I wrote the following:
//! compile-time boolean type template< bool b > struct bool_ { enum { result = b!=0 }; typedef bool_ result_t; }; template< typename T > struct is_reference : bool_<false> {}; template< typename T > struct is_reference<T&> : bool_<true> {};
It seems to me that this is easier than your decision.
However, this has only been used several times, and something may be missing.
source share