|
|
| TaggedVariant ()=default |
| | A default constructed instance has the first tag active.
|
| |
|
| TaggedVariant (const TaggedVariant &)=default |
| |
|
| TaggedVariant (TaggedVariant &&)=default |
| |
|
TaggedVariant & | operator= (const TaggedVariant &)=default |
| |
|
TaggedVariant & | operator= (TaggedVariant &&)=default |
| |
| template<typename Tag , typename... Args, Requires<(... or std::is_same_v< Tag, Tags >) and std::is_constructible_v< typename Tag::type, Args... > > = nullptr> |
| constexpr | TaggedVariant (std::in_place_type_t< Tag >, Args &&... args) |
| | Construct with Tag active, using args to construct the contained object. More...
|
| |
| template<typename... Args, Requires< sizeof...(Tags)==1 and std::is_constructible_v< typename tmpl::front< TaggedVariant >::type, Args... > > = nullptr> |
| constexpr | TaggedVariant (Args &&... args) |
| | Construct the contained object from args. Only available if the TaggedVariant only has one tag. More...
|
| |
|
constexpr size_t | index () const |
| | The index into the Tags... of the active object.
|
| |
|
constexpr bool | valueless_by_exception () const |
| | See std::variant::valueless_by_exception.
|
| |
| template<typename Tag , typename... Args, Requires<(... or std::is_same_v< Tag, Tags >) and std::is_constructible_v< typename Tag::type, Args... > > = nullptr> |
| constexpr Tag::type & | emplace (Args &&... args) |
| | Destroys the contained object and actives Tag, constructing a new value from args. More...
|
| |
|
constexpr void | swap (TaggedVariant &other) noexcept(noexcept((... and(std::is_nothrow_move_constructible_v< typename Tags::type > and std::is_nothrow_swappable_v< typename Tags::type >)))) |
| |
|
void | pup (PUP::er &p) |
| |
|
| template<typename... OtherTags, Requires< tmpl::size< tmpl::list_difference< TaggedVariant< OtherTags... >, TaggedVariant > >::value==0 > = nullptr> |
| constexpr | TaggedVariant (TaggedVariant< OtherTags... > &&other) |
| | A TaggedVariant can be implicitly move-converted to another variant with a superset of the tags. More...
|
| |
| template<typename... OtherTags, Requires< tmpl::size< tmpl::list_difference< TaggedVariant< OtherTags... >, TaggedVariant > >::value==0 > = nullptr> |
| constexpr TaggedVariant & | operator= (TaggedVariant< OtherTags... > &&other) |
| | A TaggedVariant can be implicitly move-converted to another variant with a superset of the tags. More...
|
| |
|
|
template<typename Tag , typename... Tags2> |
| constexpr Tag::type & | get (TaggedVariant< Tags2... > &variant) |
| |
|
template<typename Tag , typename... Tags2> |
| constexpr const Tag::type & | get (const TaggedVariant< Tags2... > &variant) |
| |
|
template<typename Tag , typename... Tags2> |
| constexpr Tag::type && | get (TaggedVariant< Tags2... > &&variant) |
| |
|
template<typename Tag , typename... Tags2> |
| constexpr const Tag::type && | get (const TaggedVariant< Tags2... > &&variant) |
| |
|
constexpr bool | operator== (const TaggedVariant< Tags... > &a, const TaggedVariant< Tags... > &b) |
| |
|
constexpr bool | operator (const TaggedVariant< Tags... > &a, const TaggedVariant< Tags... > &b) |
| |
|
using | options = tmpl::list< Options::Alternatives< tmpl::list< Tags >... > > |
| | A TaggedVariant over option tags can be parsed as any of them.
|
| |
|
static constexpr Options::String | help = "One of multiple options" |
| | A TaggedVariant over option tags can be parsed as any of them.
|
| |
|
template<typename Tag > |
| | TaggedVariant (tmpl::list< Tag >, typename Tag::type value) |
| | A TaggedVariant over option tags can be parsed as any of them.
|
| |
template<typename... Tags>
class variants::TaggedVariant< Tags >
A class similar to std::variant, but indexed by tag structs.
- See also
- variants::get, variants::get_if, variants::holds_alternative, variants::visit