Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion include/podio/detail/LinkCollectionIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ class LinkCollectionIteratorT {
using LinkObjT = LinkObj<FromT, ToT>;

public:
using value_type = LinkType;
// For consistency with generated collections we make the value_type an
// immutable handle always
using value_type = LinkT<FromT, ToT, false>;
using difference_type = ptrdiff_t;
using reference = LinkType;
using pointer = LinkType*;
Expand Down
3 changes: 3 additions & 0 deletions include/podio/utilities/TypeHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ concept CollectionType = !std::is_abstract_v<T> && std::derived_from<T, Collecti
typename T::mutable_type>;
requires std::same_as<std::remove_cvref_t<decltype(ct.at(std::declval<typename T::size_type>()))>,
typename T::value_type>;
requires std::same_as<typename T::value_type, typename std::iterator_traits<typename T::iterator>::value_type>;
requires std::same_as<typename T::value_type,
typename std::iterator_traits<typename T::const_iterator>::value_type>;
};

namespace utils {
Expand Down
2 changes: 2 additions & 0 deletions tests/unittests/links.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ TEST_CASE("Links templated accessors", "[links]") {
// NOLINTEND(clang-analyzer-cplusplus.NewDeleteLeaks)
TEST_CASE("LinkCollection collection concept", "[links][concepts]") {
STATIC_REQUIRE(podio::CollectionType<TestLColl>);
STATIC_REQUIRE(std::is_same_v<std::ranges::range_value_t<TestLColl>, TestL>);
STATIC_REQUIRE(std::is_same_v<std::ranges::range_value_t<const TestLColl>, TestL>);
}

TEST_CASE("LinkCollection constness", "[links][static-checks][const-correctness]") {
Expand Down
2 changes: 2 additions & 0 deletions tests/unittests/unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,8 @@ TEST_CASE("UserInitialization", "[basics][code-gen]") {
TEST_CASE("Collection concepts", "[collections][concepts]") {
STATIC_REQUIRE(podio::CollectionType<ExampleClusterCollection>);
STATIC_REQUIRE(podio::CollectionType<ExampleHitCollection>);
STATIC_REQUIRE(std::is_same_v<std::ranges::range_value_t<ExampleClusterCollection>, ExampleCluster>);
STATIC_REQUIRE(std::is_same_v<std::ranges::range_value_t<const ExampleClusterCollection>, ExampleCluster>);
}

TEST_CASE("Collection size and empty", "[basics][collections]") {
Expand Down