AUI Framework
develop
Cross-platform base for C++ UI apps
|
RTTI-wrapped range. More...
#include <AUI/Traits/any_view.h>
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.
Contents