I am trying out template programming in C++ where I programmed a template for matrix.
template <
typename T,
unsigned int R, unsigned int C>
requires StringOrArithmeticType<T>
class matrix {
...
};
From the type traits I could constrain the T to floating point and integral types. How can I do it with for example a specific type like string?
template <typename T>
concept StringOrArithmeticType =
is_integral_v<T> || is_floating_point_v<T> || is_string<T>::value;
So I implemented my own is_string. In type traits I could not find something helpful? Here I need some help, how should I solve this problem? Also, I would like to set the constrain that R and C must be greater than 1.