Can a function template be enabled whenever some expression is undefined (e.g., xof type t is not streamable to std::cout). Something like
template<typename t>
auto f(const t &x)
-> typename enable_if_undefined<decltype(std::cout << x)>::type;
Using SFINAE, I only see how to enable if the expression is defined, but not how to do it if the expression is undefined.
Aucun commentaire:
Enregistrer un commentaire