template parameter F is incompatible with the declaration...

Hi,

I have this code:

1
2
3
4
5
6
7
template <typename F, typename... Args>
struct apply : lambda<F>::type::template apply<Args...>
{};

template <template <typename> typename F, typename... Args>
struct apply : lambda<F<_1>>::type::template apply<Args...>
{};


where the intent is to specialize partially the first primary template apply. The code that calls this is something like:


 
typedef typename apply<std::add_pointer<_1>, long>::type one_pointer;


But I get


template parameter F is incompatible with the declaration...


What is going on?

Thanks,
Juan Dent
Apparently you can't have a template <typename> typename parameter. It has to be a template <typename> class, which makes sense, since classes are the only types that can be templates.

http://stackoverflow.com/questions/24081405/why-does-not-a-template-template-parameter-allow-typename-after-the-parameter
Last edited on
Topic archived. No new replies allowed.