Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-11-29 20:58:33


----- Original Message -----
From: "Hamish Mackenzie" <boost_at_[hidden]>

> How about
>
> template< typename Type, Type Value >
> struct constant
> {
> typedef Type type;
> static type const value = Value;
> operator const type &() const { return value; }
as soon as you do this--------------^^^^^^^^^^^^
> };

You need to do this:

template <typename Type, Type Value>
Type const constant<Type,Value>::value;

Some compilers think you need to do it anyway, if you use static const
instead of enum :(

-Dave


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