I mean a construct like this:
template <typename T, T defaultValue> struct Numeric { Numeric(T t=defaultValue) : value(t) { } T value; T operator=()(T t); operator T(); };
I could use it like this:
std::vector<Numeric<bool, true> > nothingButTheTruth;
My question is simple: is this a good approach, and if so, does something like this exist in the standard library or Boost?
source share