A collection_view created by lazily generating elements based on an index.
More...
#include <generate.hpp>
|
|
constexpr | generate_view (F f, Size size) |
| | Construct from a callable object and a size.
|
| |
|
template<bool Enable = true, std::enable_if_t< Enable and(not values::index< Size >), int > = 0> |
| constexpr | generate_view (F f) noexcept |
| | Construct from a callable object, if the view is unsized.
|
| |
|
constexpr | generate_view ()=default |
| | Default constructor.
|
| |
| constexpr auto | begin () |
| |
| constexpr auto | begin () const |
| |
| constexpr auto | end () |
| |
| constexpr auto | end () const |
| |
|
template<bool Enable = true, std::enable_if_t< Enable and(values::index< Size >), int > = 0> |
| constexpr auto | size () const noexcept |
| | The size of the resulting object.
|
| |
|
template<std::size_t i> |
| decltype(auto) constexpr | get () & |
| | Get element i.
|
| |
|
template<std::size_t i> |
| decltype(auto) constexpr | get () const & |
| |
|
template<std::size_t i> |
| decltype(auto) constexpr | get () &&noexcept |
| |
|
template<std::size_t i> |
| decltype(auto) constexpr | get () const &&noexcept |
| |
|
constexpr bool | empty () |
| |
|
constexpr bool | empty () const |
| |
|
constexpr auto | cbegin () |
| |
|
constexpr auto | cbegin () const |
| |
|
constexpr auto | cend () |
| |
|
constexpr auto | cend () const |
| |
|
constexpr | operator bool () |
| |
|
constexpr | operator bool () const |
| |
|
constexpr auto | size () |
| |
|
constexpr auto | size () const |
| |
|
decltype(auto) constexpr | front () |
| |
|
decltype(auto) constexpr | front () const |
| |
|
decltype(auto) constexpr | back () |
| |
|
decltype(auto) constexpr | back () const |
| |
|
decltype(auto) constexpr | operator[] (range_difference_t< D > n) |
| |
|
decltype(auto) constexpr | operator[] (range_difference_t< D > n) const |
| |
template<typename F, typename Size = values::unbounded_size_t>
struct OpenKalman::collections::generate_view< F, Size >
A collection_view created by lazily generating elements based on an index.
Typically, the generating function will be a closure.
- Template Parameters
-
| F | A callable object (possibly a closure) taking an index and producing an output value corresponding to the index. This should preferably be able to take a values::fixed index argument. |
| Size | The size of the output collection. If it is values::unbounded_size_t, the view is unsized. |
◆ begin() [1/2]
template<typename F, typename Size = values::unbounded_size_t>
- Returns
- An iterator at the beginning, if the base object is a range.
◆ begin() [2/2]
template<typename F, typename Size = values::unbounded_size_t>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ end() [1/2]
template<typename F, typename Size = values::unbounded_size_t>
- Returns
- An iterator at the end, if the base object is a range.
◆ end() [2/2]
template<typename F, typename Size = values::unbounded_size_t>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
The documentation for this struct was generated from the following file: