I am creating a template class in C++ for numeric operations and I want to restrict it to only numbers or similar numeric types. My question is that is there any way in C++ to restrict a template class to a specific domain as in java its simply:
public class num<N extends Number>{}
answers will be appreciated
std::enable_if_t
andstd::is_base_of
. – Deduplicator Oct 12 '16 at 18:26