
2 Jun
2005
2 Jun
'05
7:20 a.m.
See perhaps <boost/strong_typedef.hpp>
Unfortunately BOOST_STRONG_TYPEDEF doesn't work as expected. For example: BOOST_STRONG_TYPEDEF( int, handle ); template< typename Value > void write( const Value &value ) { } template<> void write< int >( const int &value ) { cout << "int: " << value << endl; } template<> void write< handle >( const handle &value ) { cout << "handle: " << value << endl; } int main( int, char ** ) { handle h( 8 ); write( --h ); return 0; } This code will print "int: 7" (but I'm expecting "handle: 7"). I have an implementation that deals with such cases. Sincerely, Maksym.