Displaying 1 result from an estimated 1 matches for "hasequalitycompar".
Did you mean:
hasequalitycompare
2019 Aug 01
5
RFC: Strong typedef for LLVM
...though it is often
convenient to do so.
The StrongTypedef template doesn't provide any operations outside of
explicit conversion to/from the base type. Mixin classes can imbue it
with new interfaces:
// Mixin to add equality and inequality comparison.
template<typename ST>
struct HasEqualityCompare {
friend bool operator==(const ST &LHS, const ST &RHS) {
using BaseType = typename ST::BaseType;
return (static_cast<const BaseType &>(LHS) ==
static_cast<const BaseType &>(RHS));
}
friend bool operator!=(const ST &LHS, const...