Boost logo

Boost :

From: John Maddock (John_Maddock_at_[hidden])
Date: 2001-07-14 06:29:44

>template<typename T> struct foo {
> template<typename U> struct bar : public foo<U> {};

Thanks that works.

>I think it is the same MSVC bug as in the above ::template misparsing.
>insists on finding a type (i.e. foo<U> or other<U>) but isn't satisfied by

>finding a template type parameter, so it crashes. For reference, Borland
>fails all of these testcases.

For some reason, I'm not seeing any problems with nested templates and
VC6sp3, or with VC7b1.

The following works just fine:

struct UDT1{};
struct UDT2{};

template<typename T>
struct foo
  template<typename U>
  struct bar : public foo<U>

template <class T>
void foo_test(T)
   typedef foo<T> foo_type;
   typedef typename foo_type::template bar<UDT2> bar_type;
   foo<T> ft;
   bar_type bt;

int test()
   return 0;

- John Maddock

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