@@ -140,44 +140,18 @@ struct invoker;
140140PRO4D_DEF_OVERLOAD_SPECIALIZATIONS (PRO4D_DEF_INVOKER )
141141#undef PRO4D_DEF_INVOKER
142142
143- template <class M >
144- struct PRO4D_ENFORCE_EBO inplace_meta_storage : M {
145- using M::M;
146-
147- inplace_meta_storage () = default ;
148- inplace_meta_storage (const inplace_meta_storage&) = default ;
149- template <class M2 >
150- requires (std::is_nothrow_convertible_v<const M2 &, const M&>)
151- inplace_meta_storage (const inplace_meta_storage<M2 >& rhs) noexcept
152- : M(static_cast <const M&>(*rhs)) {}
153- inplace_meta_storage& operator =(const inplace_meta_storage&) = default ;
154- template <class M2 >
155- requires (std::is_nothrow_convertible_v<const M2 &, const M&>)
156- inplace_meta_storage&
157- operator =(const inplace_meta_storage<M2 >& rhs) noexcept {
158- static_cast <M&>(*this ) = static_cast <const M&>(*rhs);
159- return *this ;
160- }
161-
162- const M& operator *() const noexcept { return *this ; }
163- };
164-
165143template <class M >
166144struct static_meta_storage {
167145 static_meta_storage () = default ;
168- template <class M2 >
169- requires (std::is_nothrow_convertible_v<const M2 &, const M&>)
170- static_meta_storage (const static_meta_storage<M2 >& rhs) noexcept
171- : ptr_(std::addressof(static_cast <const M&>(*rhs))) {}
146+ template <class P >
147+ explicit static_meta_storage (std::in_place_type_t <P>)
148+ : ptr_(std::addressof(storage<P>)) {}
172149 template <class M2 >
173150 requires (std::is_nothrow_convertible_v<const M2 &, const M&>)
174151 static_meta_storage& operator =(const static_meta_storage<M2 >& rhs) noexcept {
175152 ptr_ = std::addressof (static_cast <const M&>(*rhs));
176153 return *this ;
177154 }
178- template <class P >
179- explicit static_meta_storage (std::in_place_type_t <P>)
180- : ptr_(std::addressof(storage<P>)) {}
181155 bool has_value () const noexcept { return ptr_ != nullptr ; }
182156 void reset () noexcept { ptr_ = nullptr ; }
183157 const M& operator *() const noexcept { return *ptr_; }
@@ -189,6 +163,27 @@ struct static_meta_storage {
189163 static inline const M storage{std::in_place_type<P>};
190164};
191165
166+ template <class M >
167+ struct inplace_meta_storage : M {
168+ using M::M;
169+
170+ template <class M2 >
171+ requires (std::is_nothrow_convertible_v<const M2 &, const M&>)
172+ inplace_meta_storage&
173+ operator =(const inplace_meta_storage<M2 >& rhs) noexcept {
174+ M::operator =(*rhs);
175+ return *this ;
176+ }
177+ template <class M2 >
178+ requires (std::is_nothrow_convertible_v<const M2 &, const M&>)
179+ inplace_meta_storage& operator =(const static_meta_storage<M2 >& rhs) noexcept {
180+ M::operator =(*rhs);
181+ return *this ;
182+ }
183+
184+ const M& operator *() const noexcept { return *this ; }
185+ };
186+
192187} // namespace detail
193188
194189struct compact_facade_meta_traits {
0 commit comments