I am writing some test cases for C ++ code called demangling and I get a strange error when I try to compile this: (the following is pathologically bad C ++ code that I would never use in practice).
template<class U, class V> class TStruct { U u; V v; public: void setU(const U& newu) {u = newu; } }; template<class T, class U> class Oog { T t; U u; public: Oog(const T& _t, const U& _u) : t(_t), u(_u) {} void doit(TStruct<T,U> ts1, TStruct<U,T> ts2, U u1, T t1) {} template<class F> class Huh { F f; public: template<class V> class Wham { V v; public: Wham(const V& _v) : v(_v) {} void joy(TStruct<T,V> ts1, U u, F f) {} }; }; int chakka(const Huh<T>::Wham<U>& wu, T t) {}
The error is as follows:
"typetest.cpp", line 165: error: nontype "Oog<T, U>::Huh<F>::Wham [with F=T]" is not a template
Any ideas how I can fix this?
source share