tinymatrixmath
TMM_enable_if.hpp
1
// A reimplementation of enable_if_t, a modern C++ tool built into the standard library.
2
3
#pragma once
4
5
// Sample usage: enable_if_t<condition, function_return_type> function_name(){...; return ...;}
6
7
// Example:
8
// enable this_function only if n==1 and m==1, and its return type is Scalar
9
// enable_if_t<(n==1&&m==1), insert_return_type_here>::type() this_function(){return insert_return_type_here();}
10
11
namespace
tmm{
12
13
template
<
bool
Cond,
class
T =
void
>
struct
enable_if
{};
14
template
<
class
T>
struct
enable_if
<true, T> {
typedef
T type; };
15
16
template
<
bool
B,
class
T =
void
>
17
using
enable_if_t =
typename
enable_if<B,T>::type
;
18
19
}
tmm::enable_if
Definition:
TMM_enable_if.hpp:13
src
TMM_enable_if.hpp
Generated by
1.9.1