-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsfinae.hpp
28 lines (20 loc) · 1.49 KB
/
sfinae.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once
namespace puro {
template <typename TestType, typename Result> struct enable_if_scalar {};
template <typename Result> struct enable_if_scalar <int, Result> { typedef void type; };
template <typename Result> struct enable_if_scalar <unsigned int, Result> { typedef void type; };
template <typename Result> struct enable_if_scalar <float, Result> { typedef void type; };
template <typename Result> struct enable_if_scalar <double, Result> { typedef void type; };
template <typename Result> struct enable_if_scalar <const int, Result> { typedef void type; };
template <typename Result> struct enable_if_scalar <const unsigned int, Result> { typedef void type; };
template <typename Result> struct enable_if_scalar <const float, Result> { typedef void type; };
template <typename Result> struct enable_if_scalar <const double, Result> { typedef void type; };
template <typename TestType, typename Result>
struct enable_if_buffer {};
template <int NumChannels, int Length, typename T, typename Result>
struct enable_if_buffer <fixed_buffer<NumChannels, Length, T>, Result> { typedef Result type; };
template <int NumChannels, typename T, typename Result>
struct enable_if_buffer <buffer<NumChannels, T>, Result> { typedef Result type; };
template <int MaxNumChannels, typename T, typename Result>
struct enable_if_buffer <dynamic_buffer<MaxNumChannels, T>, Result> { typedef Result type; };
} // namespace puro