Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 1999-12-03 18:55:19

Not sure if this is exactly what you're looking for, but I'm currently
using this in my work:

template <typename Size, Size sz>
struct number
        operator Size() const {return sz;}

I'm using it as the default argument for a template parameter. The
client template sometimes needs a type like size_t that can take on
different values, and other times the client just needs a constant. The
struct number is good for those times only a constant is needed because
it is zero-sized.

You'll have to tell me whether this little animal solves your problem or


jsiek_at_[hidden] wrote on 12/3/99 6:45 PM
>Just wondering if anyone has thought of doing a traits class
>for getting the appropriate value for zero and one given
>some number type.
>et the most popular downloads on the Web. They¼re new!
>They¼re hot! Theyíre FREE! Utilities, drivers, games.
>Itís all here.
> Home:
> - Simplifying group communications

Boost list run by bdawes at, gregod at, cpdaniel at, john at