I have a concept which checks whether a type is iterable or not
template<typename T> concept Iterable = requires(T t) { t.begin(); }; I cannot use it in a template due to problems with overloading, so I'd like to do something similar to the following:
template<typename T> void universal_function(T x) { if (x is Iterable) // something which works with iterables else if (x is Printable) // another thing else // third thing }
if constevalwithif constexpr,constevaldoesn't seem relevant here.