|
Boost : |
From: Jaap Suter (J.Suter_at_[hidden])
Date: 2002-12-29 01:22:47
Hi,
I have two questions about the use of the typename-keyword when using
template-parameter dependent types.
1. Consider the following code:
template< class T >
{
typedef typename A::foo t;
};
IIRC there are some compilers that only compile the above without the
typename keyword? Is that correct (I only have the Intel and GCC compilers
at hand, so I can't check)
If so, what is the Boost policy for portable code? Perhaps there is a define
that allows something like the following?
template< class T >
{
#ifdef BOOST_INCORRECT_TYPENAME
typedef A::foo t;
#else
typedef typename A::foo t;
#endif
};
2. Can the BOOST_STATIC_CONSTANT macro deal with the following?
template< class T >
{
BOOST_STATIC_CONSTANT( typename T::foo, bar = T::value );
};
i.e. the extra typename keyword?
Thanks,
Jaap Suter
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk