I am intending to make a constant Vector
const madness::Vector<double,3> kvec(0.0, 0.0, 1.0);
By calling the following code
template <typename T>
Vector<T,3> vec(T x, T y, T z) {
Vector<T,3> r; r[0] = x; r[1] = y; r[2] = z;
return r;
}
Unfortunately, I get an error which seems to say
extra.cc:216: error: no matching function for call to ‘madness::Vector<double, 3ul>::Vector(double, double, double)’
note: candidates are: madness::Vector<T, N>::Vector(const madness::Vector<T, N>&) [with T = double, long unsigned int N = 3ul]
note: madness::Vector<T, N>::Vector() [with T = double, long unsigned int N = 3ul]
I can’t help but notice the 3ul in the error message. Why does the compiler think my innocent little three is an unsigned long?
Thanks in advance,
Nick
is your Vector class template perhaps:
And is your size_t perhaps an unsigned long?
Also, I suspect you really meant: