M
mlt
I have made a class C that contains the following fields:
typedef math::vector_type vector_type;
//ublas vector type
typedef std::vector<std::vector< vector_type > > container;
In a function I would like an argument to be the type of the elements that
the container contains:
template<C>
void fun(typename C::container::value_type::value_type & p) {
// do things with p
}
But when I compile I get the error:
error C2770: invalid explicit template argument(s)
It works fine if I just specify:
C::value_type::value_type p(3);
in the program, but I get the error when I pass p to the function 'fun':
fun<C>(p);
Any hints appreciated!
typedef math::vector_type vector_type;
//ublas vector type
typedef std::vector<std::vector< vector_type > > container;
In a function I would like an argument to be the type of the elements that
the container contains:
template<C>
void fun(typename C::container::value_type::value_type & p) {
// do things with p
}
But when I compile I get the error:
error C2770: invalid explicit template argument(s)
It works fine if I just specify:
C::value_type::value_type p(3);
in the program, but I get the error when I pass p to the function 'fun':
fun<C>(p);
Any hints appreciated!