Boost logo

Boost :

From: Miro Jurisic (macdev_at_[hidden])
Date: 2005-03-16 00:33:24


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.

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.

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.

meeroh


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