Boost logo

Boost :

From: timatdvc (timw_at_[hidden])
Date: 2002-02-14 10:02:34

Funny you should mention this, as I just posted nearly an identical
question to comp.std.c++ and comp.lang.c++.moderated ;) The reply I
received indicated that these compilers were misinterpreting the
standard, and that the code should in fact be legal.


--- In boost_at_y..., "Geurt Vos" <G.Vos_at_r...> wrote:
> I have a properties implementation ready for upload.
> However, in its current form most compilers can't
> handle it. I'm uncertain whether this is due to bad
> language support or because of non-standard code.
> Now, I will try to work around the issue (which should
> be possible), but I would like to know who's wrong (for
> a side note in the code, etc.). First note that I posted
> this question to c.l.c++.m not so long ago, but didn't
> get any response. Basically it comes down to this:
> template <typename T, T> class A { };
> template <class T> class B;
> template <typename T, T v>
> class B<A<T,v> > {
> };
> Both Borland C++ 5.5.1 and GCC 3.0.2 think it's cool.
> GCC 2.95.2 simply can't find the specialization, and
> both Intel C++ 5.0 and Comeau C++ error out
> with:
> ---
> the type of partial specialization template parameter
> constant "v" depends on another template parameter
> ---
> Section 14.5.4 [temp.class.spec], note 9 reads:
> --
> The type of a template parameter corresponding to
> a specialized nontype argument shall not be dependent
> on a parameter of the specialization.
> --
> In my case I am not specializing a nontype argument but
> a type argument, so this part (which is the only relevant
> one I could find) does not apply. In other words, the
> standard doesn't say it's invalid to use a dependent nontype
> in a specialization of a type argument, correct?
> TIA,
> Geurt

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