G
gao_bolin
I have the following situation:
template < typename T >
class A
{
};
template < template <typename> class C >
void foo(const C &c) {}
template < typename T >
void bar() {}
My problem is, is there a way to call foo from bar, supposing that a
class from
type A is passed? If there was a way to have templated typedefs, that
would be easy by adding such a definition inside class A, but
unfortunately I cannot do it.
Basically I want to do that to avoid typing explicitely type 'A' when
calling 'foo', because type A could be actually much longer than a
single letter, and second, because there is conceptually no reason an
automatic argument deduction could not take place here. (i.e. I would
type bar(a) instead of foo<A>(a) when a is, say, a A<int>).
Thanks
B.
template < typename T >
class A
{
};
template < template <typename> class C >
void foo(const C &c) {}
template < typename T >
void bar() {}
My problem is, is there a way to call foo from bar, supposing that a
class from
type A is passed? If there was a way to have templated typedefs, that
would be easy by adding such a definition inside class A, but
unfortunately I cannot do it.
Basically I want to do that to avoid typing explicitely type 'A' when
calling 'foo', because type A could be actually much longer than a
single letter, and second, because there is conceptually no reason an
automatic argument deduction could not take place here. (i.e. I would
type bar(a) instead of foo<A>(a) when a is, say, a A<int>).
Thanks
B.