requires.hpp 328 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
3
4
5
6
7
#ifndef RTG_GUARD_RTGLIB_REQUIRES_HPP
#define RTG_GUARD_RTGLIB_REQUIRES_HPP

#include <type_traits>

namespace rtg {

Paul's avatar
Paul committed
8
9
10
11
template <bool... Bs>
struct and_ : std::is_same<and_<Bs...>, and_<(Bs || true)...>>
{
};
Paul's avatar
Paul committed
12
13
14
15
16
17

#define RTG_REQUIRES(...) class = typename std::enable_if<and_<__VA_ARGS__, true>{}>::type

} // namespace rtg

#endif