But then why not just declare the Dummy_Test struct outside of your CBase class template?
Since it appears your Dummy_Test struct does not depend on the template size parameter of CBase.
Fundamentally, part of the issue is that CBase<2>::Dummy_Test and CBase<3>::Dummy_Test
are different types, as far as the compiler cares.
would be correct.
Your using solution works nicely.
How far is the scope of this using directive
1 2 3 4 5 6 7 8 9 10 11 12 13
template <std::size_t size>
using Dummy_Test = typename CBase<size>::Dummy_test;
template<std::size_t size>
class CDerived
{
void Foo(Dummy_Test<size>& test);
};
class CDerived2
{
public:
void Foo(Dummy_Test<2>& test);
}
;
It does not seem to be applied to CDerived2 because Dummy_Test<2> is not known.
So can i say that using xxx only applies to the next class or function and is not globally available?