enable_if using a constexpr bool test not working
问题 I have a maths function that I want to be able to accept either a double, or a array/vector/container of doubles, and behave slightly differently. I am attempting to use SFINAE and type traits to select the correct function. Here is a minimal example: #include <iostream> #include <vector> #include <type_traits> template <typename T> constexpr bool Iscontainer() { if constexpr (std::is_class<T>::value && std::is_arithmetic<typename T::value_type>::value) { return true; } return false; } //