Boost logo

Boost :

From: Maksym Motornyy (mmotorny_at_[hidden])
Date: 2005-06-02 02:20:57


> 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.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk