Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2007-01-23 14:16:01


There is BOOST_STRONG_TYPEDEF which is part of the serialization library.
I made it so that "typedefs" could be used as template parameters and
still be distinguishable between each other. I did leave the implict
convertability in there though so maybe its not what you need.

BOOST_STRONG_TYPEDEF Foo int;

void bar(Foo a); // ok

{
    Foo a;
    bar(a);// ok
    int b
    bar(b);// compile error

    b += a;// ok - implicit conversion like int
    ...
}

Robert Ramey
 


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net