Skip to content

Commit

Permalink
Add another assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
mingxwa committed Oct 12, 2024
1 parent 9d7a536 commit 26a4d32
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,12 @@ class proxy : public details::facade_traits<F>::direct_accessor {
private:
template <class P, class... Args>
P& initialize(Args&&... args) {
std::construct_at(reinterpret_cast<P*>(ptr_), std::forward<Args>(args)...);
P& result = *std::construct_at(
reinterpret_cast<P*>(ptr_), std::forward<Args>(args)...);
if constexpr (requires { (bool)result; })
{ assert((bool)result); }
meta_ = details::meta_ptr<typename _Traits::meta>{std::in_place_type<P>};
return *std::launder(reinterpret_cast<P*>(ptr_));
return result;
}

[[___PRO_NO_UNIQUE_ADDRESS_ATTRIBUTE]]
Expand Down

0 comments on commit 26a4d32

Please sign in to comment.