Skip to content

Commit

Permalink
remove workaround for C++17
Browse files Browse the repository at this point in the history
  • Loading branch information
m-fila committed Aug 30, 2024
1 parent 7ffc2d4 commit 20d9196
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions EDM4hepVersion.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
#define EDM4HEP_VERSION_H

#include <cstdint>
#include <tuple>
#include <ostream>
#if __cplusplus >= 202002L
#include <compare>
#endif

// Some preprocessor constants and macros for the use cases where they might be
// necessary

Expand Down Expand Up @@ -41,24 +36,7 @@ namespace edm4hep::version {
uint16_t minor{0};
uint16_t patch{0};

#if __cplusplus >= 202002L
auto operator<=>(const Version&) const = default;
#else
// No spaceship yet in c++17
#define DEFINE_COMP_OPERATOR(OP) \
constexpr bool operator OP(const Version& o) const noexcept { \
return std::tie(major, minor, patch) OP std::tie(o.major, o.minor, o.patch); \
}

DEFINE_COMP_OPERATOR(<)
DEFINE_COMP_OPERATOR(<=)
DEFINE_COMP_OPERATOR(>)
DEFINE_COMP_OPERATOR(>=)
DEFINE_COMP_OPERATOR(==)
DEFINE_COMP_OPERATOR(!=)

#undef DEFINE_COMP_OPERATOR
#endif

friend std::ostream& operator<<(std::ostream&, const Version& v);
};
Expand Down

0 comments on commit 20d9196

Please sign in to comment.