D
danilo.horta
Hi guys
I'm trying to accomplish a slightly difficult task. I think it's more
easy to explain trought an unworking code:
template<class T, size_t numDim> VecBasis {/*...*/};
typedef VecBasis<float, 3> vec3;
template<class T, size_t size> class MatBasis {
//...
template<class V = VecBasis<T, size>> V column(size_t c) const {
//...
}
};
template <class T>
template<>
inline V MatBasis<T, 3>::column<vec3>(size_t c)
{
//...
}
From the member defined inside the class, I want VecBasis<T, size> as
default template argument. In other words, a type generated by
VecBasis<> template that depends on the MatBasis<>'s template
arguments.
From the other, the user specialized one, I want the vec3 type as
member's template argument when, as you can see, the MatBasis<> uses
size = 3.
How could I accomplish it?
Cheers
I'm trying to accomplish a slightly difficult task. I think it's more
easy to explain trought an unworking code:
template<class T, size_t numDim> VecBasis {/*...*/};
typedef VecBasis<float, 3> vec3;
template<class T, size_t size> class MatBasis {
//...
template<class V = VecBasis<T, size>> V column(size_t c) const {
//...
}
};
template <class T>
template<>
inline V MatBasis<T, 3>::column<vec3>(size_t c)
{
//...
}
From the member defined inside the class, I want VecBasis<T, size> as
default template argument. In other words, a type generated by
VecBasis<> template that depends on the MatBasis<>'s template
arguments.
From the other, the user specialized one, I want the vec3 type as
member's template argument when, as you can see, the MatBasis<> uses
size = 3.
How could I accomplish it?
Cheers