5#include <libassert/assert.hpp>
6#include <range/v3/algorithm/copy.hpp>
7#include <range/v3/iterator/access.hpp>
8#include <range/v3/range/access.hpp>
9#include <range/v3/range/concepts.hpp>
10#include <range/v3/range/conversion.hpp>
11#include <range/v3/range/primitives.hpp>
12#include <range/v3/range/traits.hpp>
13#include <range/v3/view/view.hpp>
23template <ranges::range Container>
24 requires(HasStaticSize<Container>)
27 template <ranges::input_range Rng>
28 requires(ranges::sized_range<Rng>)
29 constexpr auto operator()(Rng&& rng)
const {
36 ranges::copy(std::forward<Rng>(rng), result.begin());
41template <std::
size_t N,
template <
typename, std::
size_t>
typename ArrayLike>
44 template <ranges::input_range Rng>
45 requires(ranges::sized_range<Rng>)
46 constexpr auto operator()(Rng&& rng)
const {
47 using ContainedT = ranges::range_value_t<Rng>;
49 using ContainerT = ArrayLike<ContainedT, N>;
57template <ranges::range StaticallySizedContainer>
58 requires(HasStaticSize<StaticallySizedContainer>)
60 return ranges::views::view_closure<to_static_container_fn<StaticallySizedContainer>>{};
65template <std::
size_t N,
template <
typename, std::
size_t>
typename ArrayLike>
67 return ranges::views::view_closure<to_array_like_fn<N, ArrayLike>>{};
71template <std::
size_t N>
78template <ranges::range Container>
81template <ranges::range Container>
88template <ranges::range Container>
92 using type =
decltype(ranges::to<Container>());
99template <ranges::range Container>
Definition static_size.hpp:13
Definition asm_buffer.hpp:20
consteval std::size_t get_static_size()
Definition static_size.hpp:19
constexpr auto maybe_static_to()
A pipeable adaptor to convert to any container, statically or dynamically sized. Internally uses stat...
Definition to_static_range.hpp:100
constexpr auto to_array()
A pipeable adaptor to a std::array.
Definition to_static_range.hpp:72
constexpr auto static_to()
A pipeable adaptor to convert to any static container. Just like ranges::to, but statically sized.
Definition to_static_range.hpp:59
decltype(static_to< Container >()) type
Definition to_static_range.hpp:85
Definition to_static_range.hpp:79
Definition to_static_range.hpp:43
Range adaptor function to convert a range to a static (sized at compile time) container,...
Definition to_static_range.hpp:26