29 template<
typename T,
typename U>
30 concept RebindableBoxCanConvertConstructor =
31 (!concepts::ConstructibleFrom<T, RebindableBox<U>> && !concepts::ConstructibleFrom<T, RebindableBox<U>
const> &&
32 !concepts::ConstructibleFrom<T, RebindableBox<U>&> &&
33 !concepts::ConstructibleFrom<T, RebindableBox<U>
const&> && !concepts::ConvertibleTo<RebindableBox<U>, T> &&
34 !concepts::ConvertibleTo<RebindableBox<U>
const, T> && !concepts::ConvertibleTo<RebindableBox<U>&, T> &&
35 !concepts::ConvertibleTo<RebindableBox<U>
const&, T>);
38 concept IsRebindableBox = concepts::InstanceOf<meta::RemoveCVRef<T>,
RebindableBox>;
62 detail::RebindableBoxCanConvertConstructor<T, U>)
64 : m_storage(other.
value()) {}
68 detail::RebindableBoxCanConvertConstructor<T, U>)
77 template<
typename... Args>
81 template<
typename U,
typename... Args>
84 : m_storage(list,
util::forward<Args>(args)...) {}
94 rebind(other.value());
101 rebind(util::move(other).
value());
108 rebind(other.
value());
115 rebind(util::move(other).
value());
119 template<
typename U = T>
123 rebind(util::forward<U>(
value));
127 constexpr auto value() & -> T& {
return m_storage; }
128 constexpr auto value() const& -> T const& {
return m_storage; }
129 constexpr auto value() && -> T&& {
return util::move(m_storage); }
130 constexpr auto value() const&& -> T const&& {
return util::move(m_storage); }
132 template<
typename... Args>
134 constexpr auto emplace(Args&&... args) -> T& {
140 template<
typename U,
typename... Args>
142 constexpr auto emplace(std::initializer_list<U> list, Args&&... args) -> T& {
150 constexpr void rebind(U&& new_value) {
157 if constexpr (const_assignable || !assignable) {
161 m_storage = util::forward<U>(new_value);
165 Storage m_storage {};
constexpr RebindableBox()=default
Definition rebindable_box.h:42
constexpr auto value() const &&-> T const &&
Definition rebindable_box.h:130
constexpr auto operator=(RebindableBox const &) -> RebindableBox &=default
constexpr auto value() &&-> T &&
Definition rebindable_box.h:129
constexpr auto value() &-> T &
Definition rebindable_box.h:127
constexpr RebindableBox(RebindableBox &&)=default
constexpr auto operator=(RebindableBox const &other) -> RebindableBox &requires(!concepts::TriviallyMoveAssignable< Storage > &&concepts::MoveConstructible< Storage >)
Definition rebindable_box.h:98
constexpr ~RebindableBox()=default
constexpr RebindableBox(RebindableBox const &)=delete
constexpr RebindableBox(types::InPlace, Args &&... args)
Definition rebindable_box.h:79
constexpr RebindableBox()=default
constexpr auto operator=(RebindableBox const &other) -> RebindableBox &requires(!concepts::TriviallyCopyAssignable< Storage > &&concepts::CopyConstructible< Storage >)
Definition rebindable_box.h:91
constexpr auto operator=(RebindableBox &&) -> RebindableBox &=default
constexpr RebindableBox(RebindableBox const &)=default
constexpr auto value() const &-> T const &
Definition rebindable_box.h:128
constexpr auto emplace(std::initializer_list< U > list, Args &&... args) -> T &
Definition rebindable_box.h:142
constexpr RebindableBox(U &&value)
Definition rebindable_box.h:75
constexpr auto emplace(Args &&... args) -> T &
Definition rebindable_box.h:134
constexpr RebindableBox(types::InPlace, std::initializer_list< U > list, Args &&... args)
Definition rebindable_box.h:83
Definition operations.h:19
Definition operations.h:11
Definition operations.h:99
Definition operations.h:34
Definition operations.h:24
Definition operations.h:43
RebindableBox(T &&) -> RebindableBox< meta::UnwrapRefDecay< T > >
constexpr auto make_rebindable_box(T &&value)
Definition rebindable_box.h:172
constexpr auto destroy_at
Definition destroy_at.h:24
constexpr auto construct_at
Definition construct_at.h:27
Definition any_storable.h:9