OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
variant.hpp
1#pragma once
2
3#include <ossia/detail/config.hpp>
4
5#if defined(__clang__)
6#define OSSIA_MAXIMUM_INLINE OSSIA_INLINE __attribute__((flatten))
7#else
8#define OSSIA_MAXIMUM_INLINE OSSIA_INLINE
9#endif
10
11#if __has_include(<boost/variant2.hpp>)
12#include <boost/variant2.hpp>
13namespace ossia_variant_alias = boost::variant2;
14#else
15#include <mpark/variant.hpp>
16namespace ossia_variant_alias = mpark;
17#endif
18
19namespace ossia
20{
21using monostate = ossia_variant_alias::monostate;
22#if __cpp_concepts >= 201907L
23template <typename T>
24concept nothrow_move_constructible = std::is_nothrow_move_constructible_v<T>;
25
26template <nothrow_move_constructible... Args>
27#else
28template <typename... Args>
29#endif
30using variant = ossia_variant_alias::variant<Args...>;
31
32template <typename... Args>
33using slow_variant = ossia_variant_alias::variant<Args...>;
34
35template <std::size_t N, typename T>
36using variant_element = ossia_variant_alias::variant_alternative<N, T>;
37template <std::size_t N, typename T>
38using variant_element_t = ossia_variant_alias::variant_alternative_t<N, T>;
39
40using ossia_variant_alias::operator==;
41using ossia_variant_alias::operator!=;
42using ossia_variant_alias::operator<;
43using ossia_variant_alias::operator>;
44using ossia_variant_alias::operator<=;
45using ossia_variant_alias::operator>=;
46
47// using boost::variant2::in_place;
48// using ossia_variant_alias::in_place;
49using ossia_variant_alias::get;
50using ossia_variant_alias::get_if;
51using ossia_variant_alias::in_place_index;
52using ossia_variant_alias::in_place_type;
53using ossia_variant_alias::visit;
54}
Definition git_info.h:7