Top "Enable-if" questions

class defines a public member type `type` equal to `T`; otherwise it does not.

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
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
Why does enable_if_t in template arguments complains about redefinitions?

I have the following case that works using std::enable_if : template<typename T, typename std::enable_if<…

c++ templates c++14 sfinae enable-if
How Does std::enable_if work?

I just asked this question: std::numeric_limits as a Condition I understand the usage where std::enable_if will …

c++ templates c++11 enable-if
Template specialization and enable_if problems

I am running into a problem regarding the appropriate usage of enable_if and template specialization. After modifying the example (…

c++ templates c++11 sfinae enable-if
Where is disable_if in C++0x?

Boost has both enable_if and disable_if, but C++0x seems to be missing the latter. Why was it …

c++ templates boost c++11 enable-if
How do I use std::enable_if with a self-deducing return type?

C++14 will have functions whose return type can be deduced based on the return value. auto function(){ return "hello world"; } …

c++ template-meta-programming typetraits c++14 enable-if
C++ - Iterating over a tuple & resolution of type vs constant parameters

I'm currently in the process of writing arithmetic operator overloads for tuples. The operator iterates over the tuple to perform …

c++ c++11 tuples enable-if
Issue with enable_if and multiple conditions

I tried to implement a function which converts a generic type to a string. Integral types need to be converted …

c++ templates c++14 sfinae enable-if