May 2017
Intermediate to advanced
590 pages
17h 18m
English
Developers have used a class template usually called enable_if for many years in conjunction with SFINAE to implement constraints on template types. The enable_if family of templates has become part of the C++11 standard and is implemented as follows:
template<bool Test, class T = void> struct enable_if {}; template<class T> struct enable_if<true, T> { typedef T type; };
To be able to use std::enable_if, you must include the header <type_traits>.
Read now
Unlock full access