Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2005-03-11 06:42:55


> Always use a fully qualified name to refer to an integral constant
> expression.

Correct, but see below.

> However, it appears that the same compiler (BCB6) has problems if the
> '::' is left in. For example...
>
>
> template <class T>
> struct Foo
> {
> typedef typename ::boost::remove_reference< T >::type type;
> typedef typename ::boost::add_reference<
> typename ::boost::add_const< type >::type
> >::type ref_to_const_type;
> };
>
> fails to compile. Initially I thought it had something to do with
> typename (e.g., another BOOST_DEDUCED_TYPENAME) because, the first,
> simpler line compiles if I remove the "typename" keyword.

The thing is your typedef names a *type*, and *not* an integral constant
expression, and as you have discovered, typename can't be followed by ::
when using Borland.

Keep the typename and remove the :: when using types, but keep in in when
refering to values.

Simple eh? (Just kidding).

John.


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