template template alias to a nested template?

倖福魔咒の 提交于 2019-12-05 02:55:31

At first consider using typename keyword to state that this is a nested type no matter if one is a type (e.g. struct, class, etc), template type, typedef or alias.

Alias specification requires you to use a type-id to specify a previously defined type. In this particular case correct using of type-id will look like this:

template< template<typename> class F, class T>
using neg_v2 = typename neg_f<F>::template map<T>;

// or

struct foo {};
template< template<typename> class F>
using neg_v1 = typename neg_f<F>::template map<foo>;

What you try to do originally is to use template-name neg_f<F>::mapas a type-id. This is not correct.

Probably you want to deduce somehow the T parameter from F to be used at template map<T> but this is not applicable to your final use-case fun<neg<pred>> where T is not resolved.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!