template <typename T>
void f(const typename C<T>::type& c) { }
This is allowed, but a qualified type is one of the non-deduced contexts. That is, template argument deduction won't work for this, so you'll have to call the function like so:
f(42); // won't work
f<int>(42); // works
If you don't want to supply the type argument explicitly, one option is to have the function just take a T:
template <typename T> void f(const typename T& c) { }
James McNellis
2010-06-23 01:40:00