From: Baptiste L. <gai...@fr...> - 2003-04-28 19:50:33
|
Well, I was writing the Enumerator code and I realized that we commonly use a macro in place of typename (when it is used for deduced typename). Main reason for this is portability. For instance, VC6 does not support typename for deduced type. Here is an excerpt from boost/config/suffix.hpp, that probably explain things better: --- // BOOST_DEDUCED_TYPENAME workaround ------------------------------------------// // // Some compilers don't support the use of `typename' for dependent // types in deduced contexts, e.g. // // template <class T> void f(T, typename T::type); // ^^^^^^^^ // Replace these declarations with: // // template <class T> void f(T, BOOST_DEDUCED_TYPENAME T::type); #ifndef BOOST_NO_DEDUCED_TYPENAME # define BOOST_DEDUCED_TYPENAME typename #else # define BOOST_DEDUCED_TYPENAME #endif --- One way to handle that in parsing would be to declare the macro (some project setting) as being a substitute for typename. Any other ideas ? Baptiste. |