|
AUI Framework
master
Cross-platform base for C++ UI apps
|
RTTI-wrapped range. More...
#include <AUI/Traits/any_view.h>
Classes# | |
| struct | iterator |
Public Member Functions# | |
| template<typename Rng> | |
| any_view (Rng &&rng) | |
| any_view (any_view &&rhs) noexcept=default | |
| any_view & | operator= (any_view &&rhs) noexcept=default |
| any_view (any_view &rhs) | |
| any_view (const any_view &rhs) | |
| any_view & | operator= (any_view &rhs) |
| any_view & | operator= (const any_view &rhs) |
| iterator | begin () const |
| iterator | end () const |
| dyn_range_capabilities | capabilities () const |
| T | element type |
aui::any_view is a dynamic range class that mimics the behavior of C++20 ranges/range-v3 using type-erased interfaces. It allows for the creation of runtime-checked, polymorphic ranges with input iterators.Alternative implementation of ranges::views::any_view.
The general idea is to preserve lazy nature of C++20 ranges/range-v3 and flexibility between compilation modules.
Keep in mind that type erasure can lead to performance overhead due to dynamic dispatch.
aui::any_view initialized with an lvalue reference will contain a reference to the container; thus the container can be modified.
aui::any_view initialized with an rvalue reference will move the container into itself; thus it acquires ownership.
Using aui::any_view::iterator acquired before modification of the referenced container may lead to undefined behaviour; it all depends on the referenced container.
aui::any_view follows the same principle as std::function for functors.