Boost logo

Boost :

From: Christopher Cambly (ccambly_at_[hidden])
Date: 2007-10-29 18:20:16


"John Maddock" <john_at_[hidden]> wrote on 10/27/2007 12:40:06 PM:

> Joel de Guzman wrote:
> >> Not an ideal fix, but illustrates where the change for our compiler
> >> is necessary in the Boost source. The changes would need to be made
> >> in fusion/adapter/std_pair.hpp,
> >> fusion/sequence/generation/make_vector.hpp,
> >> fusion/sequence/generation/make_list.hpp to name a few :-(
> >
> > Quite a lot. Fusion relies on it for, e.g. enable_if specialized
> > classes. I'm curious though why all fusion::tuple tests run ok
> > while the fusion::vector tests fail. The former is built using
> > the latter
> > (http://beta.boost.org/development/tests/trunk/developer/fusion.html)
> >> So there is a source work around as well as a compiler fix. Like I
> >> mentioned earlier it will be some time before the compiler change is
> >> reflected into a production compiler. One of our internal
> >> requirements that we have for publishing results is that the
> >> compiler used to publish results has to be available to customers
> >> therefore I cannot use a pre-release compiler for nightly Boost runs.
> >>
> >> How would you like to proceed?
> >
> > I'd be willing to put in workarounds (ifdefs). Alas, I do not have
> > access to this compiler. I'd appreciate help from you or someone else.
>
> Since I've been the one pushing you fix this... I don't mind spending
some
> time on this, but I don't have access to this platform/compiler either.
> Even if we could just get the TR1 tuples working that would be a big
start.
>
> John.

I can certainly help since I have access to the compiler:-) If I
understand correctly what is meant by getting TR1 tuples working, making
the change to std_pair.hpp will clean up TR1 tuple test problems.

To help explain the compiler problem we can look at the small example:

template <typename T0 = void, typename T1 = void> struct make_vector;
template <typename T0> struct make_vector<T0> { };

The compiler is analyzing the partial specialization make_vector<T0> when
the error message is emitted.

The compiler has the partial specialization, and would like to find the
primary class template. We find a candidate primary class template in
"template <typename T0 = void, typename T1 = void> struct make_vector;".
In the process of matching the partial specialization arguments to the
primary class template parameters, we think that partial specializations
are not allowed to use default parameters from the primary class template.
Since the primary template class has two parameters, and the partial
specialization explicitly specifies only one argument (ignoring the
defaulted argument) we issues the error message: (S) Too few template
arguments specified.

The work around I suggested is to have the number of arguments on the
partial specialization the same as the number of arguments on the primary
class template.

Chris Cambly
XL C++ Compiler Development


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