I am developing a library of functions in C++. These functions will be used extensively and repeatedly by me as well as others in the future. Let us say my functions are:
double SphBesselJn(const vector<double>& r, double k);
double SphBesselYn(const vector<double>& r, double k);
Should I use a namespace:
namespace SphFuncs {
double SphBesselJn(const vector<double>& r, double k);
double SphBesselYn(const vector<double>& r, double k);
}
or a static class
class SphFuncs {
public:
static double SphBesselJn(const vector<double>& r, double k);
static double SphBesselYn(const vector<double>& r, double k);
}
I know both will work. But my question to experienced C++ library developers is: Which one is better ?. I have a feeling it is the former.
I just need feedback from other C++ developers.