Hey, tnx for answer man but I wanted to know can I get the right types without using using like in my 2nd code (which is not working)
1 2 3 4
template<
template<typenameELEM, typename ALLOC> class CONTAINER
>
class X {...};
I hoped that ELEM would become passed containers element type and ALLOC respectively allocators type. This would be the most elegant solution. If I wanted to use containers value_type than I could just instantly do this
3.3 Scope
3.3.1 Declarative regions and scopes
Every name is introduced in some portion of program text called a declarative region, which is the largest part
of the program in which that name is valid, that is, in which that name may be used as an unqualified name
to refer to the same entity.
...
3.3.9 Template parameter scope
3.3.9/1 The declarative region of the name of a template parameter of a template template-parameter
is the smallest template-parameter-list in which the name was introduced.
...
// begin declarative region (template declaration)
template <
typename A,
typename B,
template <
// begin declarative region (template template-parameter-list)
typename C = A, // fine: within the template declaration where the name 'A' was introduced
typename D = C // fine: within the declarative region where the name 'C' was introduced
// end declarative region (template template-parameter-list)
> class E,
typename F = E<int,char> // fine: within the declarative region where the name 'E' was introduced
// , typename G = C *** error: outside the declarative region where the name 'C' was introduced
>
struct S
{
A a ; // fine: within the template declaration where the name 'A' was introduced
E<A,A> e ; // fine: within the template declaration where the name 'E' was introduced
// C c ; // *** error: outside the declarative region where the name 'C' was introduced
};
// end declarative region (template declaration)