I have class A and class B:

template<typename T>
struct A
{
T data;
...
};

template<typename T>
struct B
{
T data;
...
};


I can do the following:

B<A<int> > b1;
B<A<MyOtherType> > b2;


But, these lines are so ugly and I want to make special type. I want to have something like this:

myBA<int> b1;
myBA<MyOtherType> b2;


How I can do it ?
or where I can read about templates like these ?

Use typedef.

Ex : typedef A<int> myAInt;
B<myAInt> myBofAInt;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.