Run Code | API | Code Wall | Misc | Feedback | Login | Theme | Privacy | Patreon |
Trigger static_assert even when function signature is invalidError(s): source_file.cpp:17:3: error: static_assert failed "the template parameter to f should be `foo` or `bar`" static_assert(std::is_base_of<compatible_with_f, T>::value, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source_file.cpp:33:3: note: in instantiation of function template specialization 'f<int>' requested here f<int>(0); // error: no matching function for call to 'f' ^ 1 error generated. |
λ
.NET NoSQL database for rapid development
|