Boost logo

Boost :

From: Erik Wien (wien_at_[hidden])
Date: 2005-03-16 01:33:55


Thanks for your reply.

Miro Jurisic wrote:
> I tried to compile this on CW9 and I ran into two major problems that will
> probably cause you woes with other compilers as well.
>
> 1. Given the declaration:
> template<> class bar<foo> {
> template <typename baz>
> void method();
> };
>
> the correct method definition is not
>
> template<typename baz>
> void method()
> {
> }
>
> but
>
> template <>
> template<typename baz>
> void method()
> {
> }
>
> Your compiler apparently accepts the former, but I believe it's wrong.

I see. Can't remember exactly where we do that off the top of my head,
but I guess we do somewhere. :) The code works on both VC++ (7.1 and
8.0) and GCC 3.3 so that's why we haven't noticed I guess. I'll look
into that tomorrow, and fix it where applicable.

> 2. Given the declaration:
>
> template <typename foo> class Base {
> public:
> typedef int bar;
> };
>
> and a derived class
>
> template <typename foo> class Derived: public Base <foo> {
>
> you can't use unqualified "bar" inside declaration of Derived -- you have to
> qualify it with "typename Base<foo>::" (or you can use a using declaration such
> as "using Base<foo>::bar" inside the declaration of Derived). I don't know if CW
> is right on this or not -- I remember having it explained to me before, but I
> paged out the explanation.

I'm pretty sure it is an error. Now that you mention it, I have seen the
explaination for that somewhere too. I'm not sure where we actally do
that though, but I'll look into this tomorrow as well.

> Anyway, these two problems generate a bunch of compiler errors, but right now I
> am running into the problem that my boost is older than what your code requires
> so I can't submit patches yet.

Guess I should have mentioned this. Sorry. The code is using Boost 1.32
- release version.

> meeroh
>

- Erik


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