requires.hpp 404 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
template <bool... Bs>
Paul's avatar
Paul committed
9
struct and_ : std::is_same<and_<Bs...>, and_<(Bs || true)...>> // NOLINT
Paul's avatar
Paul committed
10
11
{
};
Paul's avatar
Paul committed
12

Paul's avatar
Paul committed
13
14
15
#ifdef CPPCHECK
#define RTG_REQUIRES(...) class=void
#else
Paul's avatar
Paul committed
16
#define RTG_REQUIRES(...) class = typename std::enable_if<and_<__VA_ARGS__, true>{}>::type
Paul's avatar
Paul committed
17
#endif
Paul's avatar
Paul committed
18
19
20
21

} // namespace rtg

#endif