Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2003-11-17 11:09:49

Hi Raoul,

The fact that BOOST_NESTED_TEMPLATE expands to "template" under MSVC6

The (stupid) compiler chokes when the nested class is relative to to a template
param. I've discovered this bug a few days ago.

The workaround is to derive from a class that actually defines a dummy traits
class, and from the traits class itself. Then, you can access the traits class
directly. Something like:

Original code was:
     template< class adaptor_type, class r_type>
     class r_adaptor_finder0 : public adaptor_type {
         typedef typename adaptor_type::template adapt_range0< r>::type
         typedef crange< new_container> type;

The current code is:

     struct vc6_adaptor_finder_workaround_base {
         template< class r> struct adapt_range0 {};

template< class adaptor_type, class r>
class r_adaptor_finder0 : public adaptor_type
,private ::boost::rtl::detail::vc6_adaptor_finder_workaround_base
     // FIXME this might not work on other compilers
     typedef typename adapt_range0< r>::type new_container;
     typedef crange< new_container> type;

Please write to me directly if you need more info.


Raoul Gough wrote:
> Under MSVC6, BOOST_NESTED_TEMPLATE expands to "template" instead of
> being empty. For instance, I have code where the following works on
> MSVC6, but only after I redefine BOOST_NESTED_TEMPLATE to be empty:
> typedef typename traits_by_category <max_category>
> ::BOOST_NESTED_TEMPLATE traits<Iterator>::type type;
> The config/compiler/visualc.hpp header never defines
> BOOST_NO_MEMBER_TEMPLATE_KEYWORD, even though MSVC6 has limited
> support for member templates, and doesn't accept the template keyword
> in this usage. Is this a config bug?

Boost list run by bdawes at, gregod at, cpdaniel at, john at