|
template<typename ConstructedWith>
requires constructibile_for<ConstructedWith, Proxy> && (!std::same_as<any, std::decay_t<ConstructedWith>>) && (!is_lifetime_bound<Proxy>) |
| | explicit (false) any(ConstructedWith &&const ructed_with) |
template<typename ConstructedWith>
requires constructibile_for<ConstructedWith, Proxy> && (!std::same_as<any, std::decay_t<ConstructedWith>>) && (is_lifetime_bound<Proxy>) |
| | explicit (false) any(ConstructedWith &&const ructed_with LIFETIMEBOUND) |
| template<typename V> |
| | any (std::in_place_t, V &&v) |
| template<typename T, typename... Args> |
| | any (std::in_place_type_t< T >, Args &&... args) |
|
| any (const any &other) |
|
| any (const any &other) |
|
any & | operator= (any const &other) |
template<is_any Other>
requires (borrowable_from<proxy_t, typename Other::proxy_t, typename Other::v_table_t> && (!is_dyn<Proxy> || std::derived_from<typename Other::v_table_t, v_table_t>)) |
| | explicit (false) any(const Other &other) |
template<is_any Other>
requires (borrowable_from<proxy_t, typename Other::proxy_t, typename Other::v_table_t> && (!is_dyn<Proxy> || std::derived_from<typename Other::v_table_t, v_table_t>)) |
| any & | operator= (Other const &other) |
|
template<is_proxy OtherErasedData> |
| | any (OtherErasedData &&proxy, v_table_t *v_table) noexcept |
|
template<is_proxy OtherErasedData> |
| | any (OtherErasedData &&proxy, v_table_t *v_table) noexcept |
template<is_any Other>
requires (moveable_from<proxy_t, typename Other::proxy_t> && (!is_dyn<Proxy> || std::derived_from<typename Other::v_table_t, v_table_t>)) |
| | explicit (false) any(Other &&other) noexcept |
template<is_any Other>
requires (moveable_from<proxy_t, typename Other::proxy_t> && (!is_dyn<Proxy> || std::derived_from<typename Other::v_table_t, v_table_t>)) |
| any & | operator= (Other &&other) noexcept |
|
| operator bool () const |
template<is_proxy Proxy, typename Trait>
class anyxx::any< Proxy, Trait >
The core class template to control dispatch for external polymorphism.
To control the behavior, any provides two template parameters: Proxy and Trait. Imagine this as a combination of a std::any and several std::functions.
With the Proxy template parameter, you control whether this any behaves like a copying function, a move-only function, a reference function, or if the target object is captured concretely inside of any.
With the Trait template parameter, you specify the member functions of a captured object which can be invoked on this any.
- Template Parameters
-
| Proxy | Specifies the lifetime of the captured object. Any++ provides using_, cref, mutref, shared, weak, unique, and value. All Proxy classes must conform to the is_proxy concept. |
| Trait | Specifies the functionality of this any. A class of this type is normally provided via a TRAIT or ANY macro. See there for examples. If the proxy is dynamic (i.e., type erased), the Trait must conform to the has_v_table concept (that means: must provide a v-Table). |
- Examples
- 21_Tree_any_borrow_as.cpp, _2d_trait_self.cpp, _2o_trait_simple.cpp, _3_any_range.cpp, and _5_any_template.cpp.
template<is_proxy Proxy, typename Trait>
template<typename ConstructedWith>
requires constructibile_for<ConstructedWith, Proxy> && (!std::same_as<any, std::decay_t<ConstructedWith>>) && (is_lifetime_bound<Proxy>)
| anyxx::any< Proxy, Trait >::explicit |
( |
false | | ) |
const && |
|
inline |
Type-erasing constructor for borrowing proxies. The concrete behavior is controlled by the proxy via its corresponding proxy_trait. See cref, mutref
template<is_proxy Proxy, typename Trait>
template<typename ConstructedWith>
requires constructibile_for<ConstructedWith, Proxy> && (!std::same_as<any, std::decay_t<ConstructedWith>>) && (!is_lifetime_bound<Proxy>)
| anyxx::any< Proxy, Trait >::explicit |
( |
false | | ) |
const && |
|
inline |
Type-erasing constructor for lifetime owning proxies. The concrete behavior is controlled by the proxy via its corresponding proxy_trait. See using_, shared, weak, unique, and value.