Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aliasing a template template parameters

Is it possible to use the using keyword for aliasing a template template parameter?

template <template<int> class T>
struct Foo {
    using type = T;
};

Thanks

like image 391
Mr. Anderson Avatar asked Aug 11 '26 03:08

Mr. Anderson


1 Answers

using (or typedef) always provide an alias for a type, never for an higher-kinded type (template template parameter). What you can do is templatize the alias itself on the int:

template <template<int> class T>
struct Foo {
    template <int X>
    using type = T<X>;
};
like image 54
Vittorio Romeo Avatar answered Aug 14 '26 07:08

Vittorio Romeo