Skip to content

Commit

Permalink
Make things work with c++17
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Sep 3, 2024
1 parent 0348ec6 commit cb69898
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/cpp/include/UTIL/CheckCollections.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,24 @@ namespace UTIL {
/// ReconstructedParticle and where the direction of the relation has been
/// reversed.
struct PIDMeta {
std::string name{}; ///< algorithm name
// c++17 doesn't yet have aggregate initialization in vectors, so we
// need this constructor
PIDMeta(const std::string &n, const std::vector<std::string> &parN,
uint32_t c = 0)
: name(n), paramNames(parN), count(c) {}

// Since we have one non-default constructor we need to default the rest
// explicitly
constexpr PIDMeta() = default;
PIDMeta(const PIDMeta &) = default;
PIDMeta &operator=(const PIDMeta &) = default;
PIDMeta(PIDMeta &&) = default;
PIDMeta &operator=(PIDMeta &&) = default;
~PIDMeta() = default;

std::string name{}; ///< algorithm name
std::vector<std::string> paramNames{}; ///< parameter names
uint32_t count{}; ///< How often this was found
uint32_t count{}; ///< How often this was found
};

private:
Expand Down

0 comments on commit cb69898

Please sign in to comment.