Is there a standard way to get the 0 and the 1 of a numeric type in C++. This is useful when writing linear algebra routines templated with types that could be: int
, double
, unsigned int
, ...
I am thinking of
static_cast<T>(0)
but I am wondering if there is not a better way.