5 # ifndef VCCC_OPTIONAL_INTERNAL_DTOR_H_
6 # define VCCC_OPTIONAL_INTERNAL_DTOR_H_
9 # include <type_traits>
23 constexpr dtor() noexcept
26 template<
typename ...Args>
27 constexpr
explicit dtor(in_place_t, Args&&... args)
28 : val(
std::forward<Args>(args)...),
38 constexpr
inline const value_type* pointer() const noexcept {
return vccc::addressof(val); }
39 constexpr
inline value_type* pointer() noexcept {
return vccc::addressof(val); }
41 constexpr
inline const value_type& ref() const& noexcept {
return val; }
42 constexpr
inline value_type& ref() & noexcept {
return val; }
43 constexpr
inline const value_type& ref() const&& noexcept {
return std::move(val); }
44 constexpr
inline value_type& ref() && noexcept {
return std::move(val); }
46 template<
typename ...Args>
47 void construct(Args&&... args) {
48 ::new((
void*)
vccc::addressof(val)) value_type(std::forward<Args>(args)...);
52 template<
typename Other>
53 void construct_if(Other&& other) {
55 construct(*std::forward<Other>(other));
68 struct dtor<T, false> {
71 constexpr dtor() noexcept
74 template<
typename ...Args>
75 constexpr
explicit dtor(in_place_t, Args&&... args)
76 : val(
std::forward<Args>(args)...),
86 constexpr
inline const value_type* pointer() const noexcept {
return vccc::addressof(val); }
87 constexpr
inline value_type* pointer() noexcept {
return vccc::addressof(val); }
89 constexpr
inline const value_type& ref() const& noexcept {
return val; }
90 constexpr
inline value_type& ref() & noexcept {
return val; }
91 constexpr
inline const value_type& ref() const&& noexcept {
return std::move(val); }
92 constexpr
inline value_type& ref() && noexcept {
return std::move(val); }
94 template<
typename ...Args>
95 void construct(Args&&... args) {
96 ::new((
void*)
vccc::addressof(val)) value_type(std::forward<Args>(args)...);
100 template<
typename Other>
101 void construct_if(Other&& other) {
103 construct(*std::forward<Other>(other));
std::enable_if_t< std::is_object< T >::value, T * > addressof(T &t) noexcept
Definition: addressof.hpp:33
Definition: matrix.hpp:495
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35