1111#include < ranges>
1212
1313namespace Acts ::Ranges {
14+
15+ // / Adaptor for converting a range to a container
16+ // / @tparam Container the container type to convert to
1417template <template <typename ...> class Container >
1518struct 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
2537template <typename Range, template <typename ...> class Container >
2638auto 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
3145template <template <typename ...> class Container >
3246inline constexpr to_adaptor<Container> to{};
3347
0 commit comments