Consider the following class template.
template<template<typename U> typename T>
class Entity {
// Something
};
What is the proper syntax to specialize Entity
explicitly:
U
,T
(keeping it as a template)?I cannot find out the proper syntax for this task. The cppreference page does not provide any examples on this issue.
Here an example of specialization:
template <template<typename> typename C>
class Entity {
// Something
};
template <typename>
struct A{};
template <>
class Entity<A>
{
// ...
};
// Usage is Entity<A> entity;
But you probably want something like:
template <typename T>
class Entity {
// Something
};
template <typename>
struct A{};
template <typename T>
class Entity<A<T>>
{
// ...
};
template <typename T, template <typename> class C>
class Entity<C<T>>
{
// ...
};
// Usage is Entity<A<int>> entity;