Skip to content

Commit

Permalink
Make things work again (again) with c++17
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Sep 11, 2024
1 parent d407c31 commit 357d37c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/podio/detail/RelationIOHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace podio::detail {
/// @param id The ObjectID of the element that we are currently looking for
template <typename T, typename InterfaceType>
void tryAddTo(T, std::vector<InterfaceType>& relElements, const podio::CollectionBase* coll, const podio::ObjectID id) {
if (auto typedColl = dynamic_cast<const T::collection_type*>(coll)) {
if (auto typedColl = dynamic_cast<const typename T::collection_type*>(coll)) {
const T tmp = (*typedColl)[id.index];
relElements.emplace_back(tmp);
}
Expand Down Expand Up @@ -87,7 +87,7 @@ void addMultiRelation(std::vector<RelType>& relElements, const podio::Collection
if constexpr (podio::detail::isInterfaceType<RelType>) {
addInterfaceToMultiRelation(relElements, coll, id);
} else {
const auto* typeColl = static_cast<const RelType::collection_type*>(coll);
const auto* typeColl = static_cast<const typename RelType::collection_type*>(coll);
relElements.emplace_back((*typeColl)[id.index]);
}
}
Expand All @@ -111,7 +111,7 @@ void addMultiRelation(std::vector<RelType>& relElements, const podio::Collection
/// @param id The ObjectID of the element that we are currently looking for
template <typename T, typename InterfaceType>
void tryAssignTo(T, InterfaceType*& relation, const podio::CollectionBase* coll, const podio::ObjectID id) {
if (const auto* typeColl = dynamic_cast<const T::collection_type*>(coll)) {
if (const auto* typeColl = dynamic_cast<const typename T::collection_type*>(coll)) {
relation = new InterfaceType((*typeColl)[id.index]);
}
}
Expand Down Expand Up @@ -168,7 +168,7 @@ void addSingleRelation(RelType*& relation, const podio::CollectionBase* coll, co
if constexpr (podio::detail::isInterfaceType<RelType>) {
addInterfaceToSingleRelation(relation, coll, id);
} else {
const auto* typeColl = static_cast<const RelType::collection_type*>(coll);
const auto* typeColl = static_cast<const typename RelType::collection_type*>(coll);
relation = new RelType((*typeColl)[id.index]);
}
}
Expand Down

0 comments on commit 357d37c

Please sign in to comment.