B
bluekite2000
I have
//vector_header.h
template <typename T>
class Vector
{
....
}
//vector_func.h
#include vector_header.h
template<typename T>
Vector<T> sqrt(Vector<T>& Vin);
#include "vector_func.cc"
//vector_func.cc
template<typename T>
Vector<T> sqrt(Vector<T>& Vin)
{
....
}
My question is: Is sqrt() logically a part of class Vector? If it s
not, should I make it so? How do I go about making it a part of class
Vector? I d rather not put it in the same header file. Can I put it in
the same namespace instead?
//vector_header.h
template <typename T>
class Vector
{
....
}
//vector_func.h
#include vector_header.h
template<typename T>
Vector<T> sqrt(Vector<T>& Vin);
#include "vector_func.cc"
//vector_func.cc
template<typename T>
Vector<T> sqrt(Vector<T>& Vin)
{
....
}
My question is: Is sqrt() logically a part of class Vector? If it s
not, should I make it so? How do I go about making it a part of class
Vector? I d rather not put it in the same header file. Can I put it in
the same namespace instead?