When CRTP is used inside a template, (or generally when a template parameter is passed as a base class template argument), is it impossible to name the base\'s member templates
The following works fine with C++11:
#include <iostream>
template< typename d >
struct base {
template< typename >
struct ct {};
template< typename >
void ft() {std::cerr << "cheesecake" << std::endl;}
};
template< typename x >
struct derived : base< derived< x > > {
template<typename X>
using ct = typename derived::base::template ct<X>; // new in C++11
using derived::base::ft;
};
int main()
{
derived<int>::ct<float> c;
derived<int> a;
a.ft<int>();
}
If that is not what you wanted, can you please give an example of how you would want to use ct and ft?