Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-08-03 07:19:10


From: "John Maddock" <john_maddock_at_[hidden]>

> > it seems that MSVC has problems with multiple default template
> > arguments for class templates. For instance it doesn't understand the
> > declaration in dynamic_bitset_fwd.hpp unless you re-write it in the
> > (non-equivalent, of course) form:
> >
> >
> > template <typename Block, typename Allocator = std::allocator<Block> >
> > class dynamic_bitset;
> >
> >
> > What about adding a new config macro, e.g.
> > BOOST_NO_MULTIPLE_DEFAULT_TEMPLATE_ARGUMENTS, that deals with this?
> >
> >
> > A test case for MSVC 6.0 SP5 is
> >
> > template <class A = int, class B = A>
> > class Test {};
> >
> > which results in an internal compiler error.
> >
> >
> > I'm not sure about the situations in which the problem reveals itself,
> > so maybe the name of the macro isn't even appropriate but, regardless
> > of the name, I think some macro is useful. Opinions?
>
> Looks reasonable, I'll try and add it some time over the next few days
> unless there are any other comments.

Well, I didn't think I was going to have to say anything, but the name at
least is crazy. Normally there's no problem in using multiple default
arguments with that compiler, and we do it all the time in boost libs.
Possibly this problem occurs only when one default argument expression uses
the type of another argument with a default?

-Dave

-----------------------------------------------------------
           David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com


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