Run Code | API | Code Wall | Misc | Feedback | Login | Theme | Privacy | Patreon |
gcc failError(s): source_file.cpp: In function ‘int main()’: source_file.cpp:98:11: error: no matching function for call to ‘fn()’ fn<3>(); ^ source_file.cpp:92:10: note: candidate: template<int I, typename std::enable_if<is_value(I).one_of(3, 2, 1), detail::enabler>::type <anonymous> > void fn() void fn() ^ source_file.cpp:92:10: note: template argument deduction/substitution failed: source_file.cpp:16:92: error: ‘constexpr bool detail::is_value<T, IS_BUILTIN>::one_of(const T1&, const Ts& ...) const [with T1 = int; Ts = {int, int}; T = int; bool IS_BUILTIN = true]’ called in a constant expression #define ENABLE_IF(...) std::enable_if_t<(__VA_ARGS__), detail::enabler> = detail::enabler::enabled ^ source_file.cpp:91:18: note: in expansion of macro ‘ENABLE_IF’ template <int I, ENABLE_IF(is_value(I).one_of(3,2,1))> ^ source_file.cpp:38:18: note: ‘constexpr bool detail::is_value<T, IS_BUILTIN>::one_of(const T1&, const Ts& ...) const [with T1 = int; Ts = {int, int}; T = int; bool IS_BUILTIN = true]’ is not usable as a constexpr function because: constexpr bool one_of(T1 const & item, Ts const&...args) const ^ source_file.cpp:38:18: error: enclosing class of constexpr non-static member function ‘constexpr bool detail::is_value<T, IS_BUILTIN>::one_of(const T1&, const Ts& ...) const [with T1 = int; Ts = {int, int}; T = int; bool IS_BUILTIN = true]’ is not a literal type source_file.cpp:22:8: note: ‘detail::is_value<int, true>’ is not literal because: class is_value ^ source_file.cpp:22:8: note: ‘detail::is_value<int, true>’ has a non-trivial destructor source_file.cpp:16:92: note: in template argument for type ‘bool’ #define ENABLE_IF(...) std::enable_if_t<(__VA_ARGS__), detail::enabler> = detail::enabler::enabled ^ source_file.cpp:91:18: note: in expansion of macro ‘ENABLE_IF’ template <int I, ENABLE_IF(is_value(I).one_of(3,2,1))> ^ source_file.cpp:16:92: note: invalid template non-type parameter #define ENABLE_IF(...) std::enable_if_t<(__VA_ARGS__), detail::enabler> = detail::enabler::enabled ^ source_file.cpp:91:18: note: in expansion of macro ‘ENABLE_IF’ template <int I, ENABLE_IF(is_value(I).one_of(3,2,1))> ^ |
λ
.NET NoSQL database for rapid development
|