Top "Sfinae" questions

Substitution failure is not an error.

How can I add reflection to a C++ application?

I'd like to be able to introspect a C++ class for its name, contents (i.e. members and their types) …

c++ reflection templates sfinae
Templated check for the existence of a class member function?

Is it possible to write a template that changes behavior depending on if a certain member function is defined on …

c++ templates template-meta-programming sfinae
Check if a class has a member function of a given signature

I'm asking for a template trick to detect if a class has a specific member function of a given signature. …

c++ c++11 templates sfinae
C++ SFINAE examples?

I want to get into more template meta-programming. I know that SFINAE stands for "substitution failure is not an error." …

c++ templates metaprogramming sfinae
Why should I avoid std::enable_if in function signatures

Scott Meyers posted content and status of his next book EC++11. He wrote that one item in the book could …

c++ templates c++11 sfinae enable-if
How to detect whether there is a specific member variable in class?

For creating algorithm template function I need to know whether x or X (and y or Y) in class that …

c++ visual-studio templates g++ sfinae
check if member exists using enable_if

Here's what I'm trying to do: template <typename T> struct Model { vector<T> vertices ; #if T …

c++ templates sfinae
Select class constructor using enable_if

Consider following code: #include <iostream> #include <type_traits> template <typename T> struct A { int …

c++ templates constructor sfinae
Why compile error with enable_if

Why this does not compile with gcc48 and clang32? #include <type_traits> template <int N> struct …

c++ templates metaprogramming sfinae enable-if
How to write a type trait `is_container` or `is_vector`?

Is it possible to write a type trait whose value is true for all common STL structures (e.g., vector, …

c++ templates sfinae enable-if