On Wednesday, June 4, 2003, at 3:54 PM, Beman Dawes wrote:

Hum... I just had a thought. Is it possible to detect if wchar_t is a typedef at compile time?

Yes, I think so. Won't boost::is_same< unsigned short, wchar_t >::value be true if wchar_t is a typedef, and false if a distinct > type?

I'll do some experiments.

The method you gave may not work. Who says that "unsigned short" is the type that "wchar_t" rips off? What about something like:


// If wchar_t is a distinct type, this version will be used
template < typename T >
struct my_tester
{
    BOOST_STATIC_CONSTANT( bool, value = false );
};

// Do this specialization for every built-in integral type
// EXCEPT wchar_t
template <  >
struct my_tester< bool >
{
    BOOST_STATIC_CONSTANT( bool, value = true );
};

//...

int main()
{
    return my_tester<wchar_t>::value;
}

Daryle

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to