Skip to content

Commit

Permalink
Add a few comments and a requirement on is_map_like
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Mar 27, 2024
1 parent dce3f33 commit eb37d7e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion k4FWCore/include/k4FWCore/FunctionalUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,14 @@ namespace k4FWCore {
return static_cast<const T>(*arg);
}

// Check if the type is a map like type, where map type is the special map
// type to have an arbitrary number of collections as input or output:
// std::map<std::string, Coll> where Coll is the collection type
template <typename T> struct is_map_like : std::false_type {};

template <typename Value> struct is_map_like<std::map<std::string, Value>> : std::true_type {};
template <typename Value>
requires std::is_base_of_v<podio::CollectionBase, std::remove_cvref_t<Value>>
struct is_map_like<std::map<std::string, Value>> : std::true_type {};

// transformType function to transform the types from the ones that the user wants
// like edm4hep::MCParticleCollection, to the ones that are actually stored in the
Expand Down

0 comments on commit eb37d7e

Please sign in to comment.