Skip to content

Commit 375b870

Browse files
committed
ranges::to docs
1 parent 12891e7 commit 375b870

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Core/include/Acts/Utilities/Ranges.hpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@
1111
#include <ranges>
1212

1313
namespace Acts::Ranges {
14+
15+
/// Adaptor for converting a range to a container
16+
/// @tparam Container the container type to convert to
1417
template <template <typename...> class Container>
1518
struct to_adaptor {
19+
/// Convert a range to a container
20+
/// @tparam Range the range type to convert
21+
/// @param range the range to convert
22+
/// @return the converted container
1623
template <typename Range>
1724
auto operator()(Range&& range) const {
1825
using ValueType = std::ranges::range_value_t<Range>;
@@ -21,13 +28,20 @@ struct to_adaptor {
2128
}
2229
};
2330

24-
// Overload operator| for piping
31+
/// Overload operator| for piping
32+
/// @tparam Range the range type to convert
33+
/// @tparam Container the container type to convert to
34+
/// @param range the range to convert
35+
/// @param adaptor the adaptor to use
36+
/// @return the converted container
2537
template <typename Range, template <typename...> class Container>
2638
auto operator|(Range&& range, to_adaptor<Container> adaptor) {
2739
return adaptor(std::forward<Range>(range));
2840
}
2941

30-
// Create the adaptor objects
42+
/// Create the adaptor objects
43+
/// @tparam Container the container type to convert to
44+
/// @return the adaptor object
3145
template <template <typename...> class Container>
3246
inline constexpr to_adaptor<Container> to{};
3347

0 commit comments

Comments
 (0)