In C++11 you can use template aliases
template<class X>
using Bind_CPP11 = generic<X, Y>;
template<class X, template<class> class Impl>
struct wrapper_CPP11
{
Impl<X> foo;
};
In C++98/03, you can use simple class composition (I would not use inheritance here)
template<class X>
struct Bind_CPP03
{
typedef generic<X, Y> type;
};
template<class X, template<class> class Impl>
struct wrapper_CPP03
{
typename Impl<X>::type foo;
// ^^^^^^^^ to extract dependent type
};
Please check this link [reffrence][1]
[1]: https://stackoverflow.com/questions/18057750/partial-template-binding-create-new-template-as-type
I hope this will helps you.
Thanks.
In C++11 you can use **template aliases**
template<class X>
using Bind_CPP11 = generic<X, Y>;
template<class X, template<class> class Impl>
struct wrapper_CPP11
{
Impl<X> foo;
};
In C++98/03, you can use simple [**class composition**][1] (I would not use inheritance here)
template<class X>
struct Bind_CPP03
{
typedef generic<X, Y> type;
};
template<class X, template<class> class Impl>
struct wrapper_CPP03
{
typename Impl<X>::type foo;
// ^^^^^^^^ to extract dependent type
};
[**Live Example**][2].
[1]: https://stackoverflow.com/a/649726/819272
[2]: http://coliru.stacked-crooked.com/view?id=8f594409c5ec1dd1eb98d8c2edf4b71f-b3a39f4e9c268c2df146ea17ecc4d5fd