My Project
bsl::enable_if< B, T > Class Template Referencefinal

Defines a conditional "if" statement for SFINAE overload resolution. If B is true, bsl::enable_if has a public member typedef of type T, otherwise, there is no public member typedef. More...

#include <enable_if.hpp>

Detailed Description

template<bool B, typename T = void>
class bsl::enable_if< B, T >

Defines a conditional "if" statement for SFINAE overload resolution. If B is true, bsl::enable_if has a public member typedef of type T, otherwise, there is no public member typedef.

#include <bsl/debug.hpp>
namespace bsl
{
template< // --
typename T, // --
constexpr bool
foo() noexcept
{
return true;
}
template< // --
typename T, // --
constexpr bool
foo() noexcept
{
return false;
}
inline void
example_enable_if_overview() noexcept
{
if (foo<bool>()) {
bsl::print() << "success\n";
}
if (!foo<void>()) {
bsl::print() << "success\n";
}
}
}
Template Parameters
Bif B is true, bsl::enable_if has a public member typedef of type T, otherwise, there is no public member typedef.
Tthe type of typedef that is defined if B is true

The documentation for this class was generated from the following file: