Write this:
template <class T>
template <class U>
void MyClass<T>::foo() { /* ... */ }
More Related Contents:
- Can a class member function template be virtual?
- Variadic function template with pack expansion not in last parameter
- How to pass a template function in a template argument list
- Why do two functions have the same address?
- What is the curiously recurring template pattern (CRTP)?
- What is a nondeduced context?
- How to emulate C array initialization “int arr[] = { e1, e2, e3, … }” behaviour with std::array?
- In a templated derived class, why do I need to qualify base class member names with “this->” inside a member function?
- C++ static polymorphism (CRTP) and using typedefs from derived classes
- Propagating ‘typedef’ from based to derived class for ‘template’
- Static member initialization in a class template
- C++ templates Turing-complete?
- What is “Expression SFINAE”?
- Can the template parameters of a constructor be explicitly specified?
- template member function of template class called from template function
- C-Style Strings as template arguments? [duplicate]
- Template within template: why “`>>’ should be `> >’ within a nested template argument list”
- Limiting range of value types in C++
- Parameter pack must be at the end of the parameter list… When and why?
- Can lambda functions be templated?
- Deducing first template argument with other template parameters defaulted
- Disambiguate overloaded member function pointer being passed as template parameter
- How to correctly initialize member variable of template type?
- C++ parameter pack, constrained to have instances of a single type?
- Most terse and reusable way of wrapping template or overloaded functions in function objects
- using class name in a class template without template parameters
- Template instantiation details of GCC and MS compilers
- How can I expand call to variadic template base classes?
- Template Metaprogramming – Difference Between Using Enum Hack and Static Const
- How does C++ link template instances