Boost logo

Boost :

From: Chris Trengove (trengove_at_[hidden])
Date: 2003-03-17 21:41:45


"Alisdair Meredith" <alisdair.meredith_at_[hidden]> wrote in message
news:3E4CDE85.FA5165DA_at_uk.renaultf1.com...
> Several of the boost libraries select functionality based on the result
> of some compile-time test. The result is usually stored in a
> BOOST_STATIC_CONST( bool, test::value );
>
> The current Borland compiler does not allow these values to be used as
> template parameters though.

Are you referring to the compiler message

E2231 "Member ... cannot be used without an object" ?

For example, this is produced whenever you have something like

template <class T>
struct Y {
    static const bool value = ... // some test here.
    typedef X<value>::type type; // X is some other template
};

I think you can get rid of the compilation error just be qualifying the use
of "value". For example,

   typedef X<Y::value>::type type;

I have recently been attempting to port Boost.Python to BCC and have come
across lots of examples of this. The compilation errors all go away when the
static member is expilcitly qualified.

I also note that random/uniform_int.hpp and random/uniform_smallint.hpp have
just been patched to get around this problem, but just explictly qualifying
the member also fixes the compilation errors.


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