On 19 ago, 11:09, "saneman" <as...@asd.comwrote:
I have something like this:
template<typename math, typename real, typename vector, typename matrix>
void fun(real a, vector v, matrix m)
{
* * * * typedef typename math::line line;
* * * * .....
}
but real, vector and matrix are all types included in math. Is there some
technique to only supply math as a template parameter eventhough real,
vector and matrix are used as function arguments in fun?
Hi.
Yes, the same way you did inside the function body:
template<typename math>
void fun(typename math::real a, typename math::vector v,
typename::matrix m)
{
typedef typename math::line line;
.....
}
Probably, you also might wanna consider passing those parameter by
const-ref (or just by ref if you're to modify them). For example:
const typename math::real&.
--
Leandro T. C. Melo