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 23, 2024
1 parent 4b7a401 commit 7e9933e
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 7e9933e

Please sign in to comment.