In order to avoid code repetition, I need to do something like this (in my real code I have much more complex types similar to T1
and T2
):
template <class T1, class T2>
struct A
{};
template <class T1, class T2>
struct B
{};
template <class X>
struct C
{
using p1 = int;
using p2 = char;
using some = X<p1, p2>;
};
int main()
{
C<A> o1; // must produce C<A<int,char> >
C<B> o2; // must produce C<B<int,char> >
}
C<A>::some o1;
andC<B>::some o2;
? – Ectoblast