#ifndef MIGRAPH_GUARD_MIGRAPHLIB_REQUIRES_HPP #define MIGRAPH_GUARD_MIGRAPHLIB_REQUIRES_HPP #include namespace migraph { template struct and_ : std::is_same, and_<(Bs || true)...>> // NOLINT { }; template using bool_c = std::integral_constant; template struct requires_enum { enum e { A = 0 }; }; #define MIGRAPH_REQUIRES_CAT(x, y) x##y #ifdef CPPCHECK #define MIGRAPH_REQUIRES(...) class = void #else #if 0 // TODO: This current crashed on clang #define MIGRAPH_REQUIRES(...) \ typename migraph::requires_enum<__LINE__>::e MIGRAPH_REQUIRES_CAT( \ PrivateRequires, \ __LINE__) = migraph::requires_enum<__LINE__>::A, \ class = typename std::enable_if::A>{}>::type #else #define MIGRAPH_REQUIRES(...) \ typename migraph::requires_enum<__LINE__>::e MIGRAPH_REQUIRES_CAT( \ PrivateRequires, __LINE__) = migraph::requires_enum<__LINE__>::A, \ class = typename std::enable_if{}>::type #endif #endif } // namespace migraph #endif