MCPcopy Create free account
hub / github.com/covscript/covscript / compare_helper

Class compare_helper

include/covscript/core/variable.hpp:39–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37// Compare
38 template <typename _Tp>
39 class compare_helper {
40 template <typename T, typename X = bool>
41 struct matcher;
42
43 template <typename T>
44 static constexpr bool match(T *)
45 {
46 return false;
47 }
48
49 template <typename T>
50 static constexpr bool match(matcher<T, decltype(std::declval<T>() == std::declval<T>())> *)
51 {
52 return true;
53 }
54
55 public:
56 static constexpr bool value = match<_Tp>(nullptr);
57 };
58
59 template <typename, bool>
60 struct compare_if;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected