Skip to content

Commit

Permalink
Make lambda capture simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Sep 13, 2024
1 parent 5067eb6 commit af032d8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions include/podio/detail/RelationIOHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ void tryAddTo(T, std::vector<InterfaceType>& relElements, const podio::Collectio
template <typename InterfaceType>
void addInterfaceToMultiRelation(std::vector<InterfaceType>& relElements, const podio::CollectionBase* coll,
const podio::ObjectID id) {
std::apply([&relElements, &coll, &id](auto... t) { (tryAddTo(t, relElements, coll, id), ...); },
typename InterfaceType::interfaced_types{});
std::apply([&](auto... t) { (tryAddTo(t, relElements, coll, id), ...); }, typename InterfaceType::interfaced_types{});
}

/// Helper function for adding an object to the OneToManyRelations container
Expand Down Expand Up @@ -132,8 +131,7 @@ void tryAssignTo(T, InterfaceType*& relation, const podio::CollectionBase* coll,
template <typename InterfaceType>
void addInterfaceToSingleRelation(InterfaceType*& relation, const podio::CollectionBase* coll,
const podio::ObjectID id) {
std::apply([&relation, &coll, &id](auto... t) { (tryAssignTo(t, relation, coll, id), ...); },
typename InterfaceType::interfaced_types{});
std::apply([&](auto... t) { (tryAssignTo(t, relation, coll, id), ...); }, typename InterfaceType::interfaced_types{});
}

/// Helper function for assigning the related object in a OneToOneRelation
Expand Down

0 comments on commit af032d8

Please sign in to comment.