diff --git a/docs/spec/allocate_proxy.md b/docs/spec/allocate_proxy.md index accb35a..1b64913 100644 --- a/docs/spec/allocate_proxy.md +++ b/docs/spec/allocate_proxy.md @@ -8,23 +8,23 @@ The definition of `allocate_proxy` makes use of an exposition-only class templat ```cpp // (1) +template +proxy allocate_proxy(const Alloc& alloc, T&& value); // freestanding-deleted + +// (2) template proxy allocate_proxy(const Alloc& alloc, Args&&... args); // freestanding-deleted -// (2) +// (3) template proxy allocate_proxy(const Alloc& alloc, std::initializer_list il, Args&&... args); // freestanding-deleted - -// (3) -template -proxy allocate_proxy(const Alloc& alloc, T&& value); // freestanding-deleted ``` -`(1)` Creates a `proxy` object containing a value `p` of type *allocated-ptr<T, Alloc>*, where `*p` is direct-non-list-initialized with `std::forward(args)...`. +`(1)` Creates a `proxy` object containing a value `p` of type *allocated-ptr<*`std::decay_t`*, Alloc>*, where `*p` is direct-non-list-initialized with `std::forward(value)`. -`(2)` Creates a `proxy` object containing a value `p` of type *allocated-ptr<T, Alloc>*, where `*p` is direct-non-list-initialized with `il, std::forward(args)...`. +`(2)` Creates a `proxy` object containing a value `p` of type *allocated-ptr<T, Alloc>*, where `*p` is direct-non-list-initialized with `std::forward(args)...`. -`(3)` Creates a `proxy` object containing a value `p` of type *allocated-ptr<*`std::decay_t`*, Alloc>*, where `*p` is direct-non-list-initialized with `std::forward(value)`. +`(3)` Creates a `proxy` object containing a value `p` of type *allocated-ptr<T, Alloc>*, where `*p` is direct-non-list-initialized with `il, std::forward(args)...`. *Since 3.3.0*: For `(1-3)`, if [`proxiable_target, F>`](proxiable_target.md) is `false`, the program is ill-formed and diagnostic messages are generated. diff --git a/docs/spec/allocate_proxy_shared.md b/docs/spec/allocate_proxy_shared.md index 06a9ace..7bfd32b 100644 --- a/docs/spec/allocate_proxy_shared.md +++ b/docs/spec/allocate_proxy_shared.md @@ -9,23 +9,23 @@ The definition of `allocate_proxy_shared` makes use of exposition-only class tem ```cpp // (1) +template +proxy allocate_proxy_shared(const Alloc& alloc, T&& value); // freestanding-deleted + +// (2) template proxy allocate_proxy_shared(const Alloc& alloc, Args&&... args); // freestanding-deleted -// (2) +// (3) template proxy allocate_proxy_shared(const Alloc& alloc, std::initializer_list il, Args&&... args); // freestanding-deleted - -// (3) -template -proxy allocate_proxy_shared(const Alloc& alloc, T&& value); // freestanding-deleted ``` -`(1)` Creates a `proxy` object containing a value `p` of type *strong-compact-ptr<T, Alloc>*, where `*p` is direct-non-list-initialized with `std::forward(args)...`. +`(1)` Creates a `proxy` object containing a value `p` of type *strong-compact-ptr<*`std::decay_t`*, Alloc>*, where `*p` is direct-non-list-initialized with `std::forward(value)`. -`(2)` Creates a `proxy` object containing a value `p` of type *strong-compact-ptr<T, Alloc>*, where `*p` is direct-non-list-initialized with `il, std::forward(args)...`. +`(2)` Creates a `proxy` object containing a value `p` of type *strong-compact-ptr<T, Alloc>*, where `*p` is direct-non-list-initialized with `std::forward(args)...`. -`(3)` Creates a `proxy` object containing a value `p` of type *strong-compact-ptr<*`std::decay_t`*, Alloc>*, where `*p` is direct-non-list-initialized with `std::forward(value)`. +`(3)` Creates a `proxy` object containing a value `p` of type *strong-compact-ptr<T, Alloc>*, where `*p` is direct-non-list-initialized with `il, std::forward(args)...`. For `(1-3)`, if [`proxiable_target, F>`](proxiable_target.md) is `false`, the program is ill-formed and diagnostic messages are generated. diff --git a/docs/spec/make_proxy.md b/docs/spec/make_proxy.md index d0cd8bb..3db05d4 100644 --- a/docs/spec/make_proxy.md +++ b/docs/spec/make_proxy.md @@ -19,23 +19,23 @@ proxy make-proxy-internal(Args&&... args) { ```cpp // (1) +template +proxy make_proxy(T&& value); // freestanding-deleted + +// (2) template proxy make_proxy(Args&&... args); // freestanding-deleted -// (2) +// (3) template proxy make_proxy(std::initializer_list il, Args&&... args); // freestanding-deleted - -// (3) -template -proxy make_proxy(T&& value); // freestanding-deleted ``` -`(1)` Equivalent to `return make-proxy-internal(std::forward(args)...)`. +`(1)` Equivalent to `return make-proxy-internal>(std::forward(value))`. -`(2)` Equivalent to `return make-proxy-internal(il, std::forward(args)...)`. +`(2)` Equivalent to `return make-proxy-internal(std::forward(args)...)`. -`(3)` Equivalent to `return make-proxy-internal>(std::forward(value))`. +`(3)` Equivalent to `return make-proxy-internal(il, std::forward(args)...)`. *Since 3.3.0*: For `(1-3)`, if [`proxiable_target, F>`](proxiable_target.md) is `false`, the program is ill-formed and diagnostic messages are generated. diff --git a/docs/spec/make_proxy_inplace.md b/docs/spec/make_proxy_inplace.md index ba72878..b8928e2 100644 --- a/docs/spec/make_proxy_inplace.md +++ b/docs/spec/make_proxy_inplace.md @@ -8,30 +8,30 @@ The definition of `make_proxy_inplace` makes use of an exposition-only class tem ```cpp // (1) +template +proxy make_proxy_inplace(T&& value) + noexcept(std::is_nothrow_constructible_v, T>) + requires(std::is_constructible_v, T>); + +// (2) template proxy make_proxy_inplace(Args&&... args) noexcept(std::is_nothrow_constructible_v) requires(std::is_constructible_v); -// (2) +// (3) template proxy make_proxy_inplace(std::initializer_list il, Args&&... args) noexcept(std::is_nothrow_constructible_v< T, std::initializer_list&, Args...>) requires(std::is_constructible_v&, Args...>); - -// (3) -template -proxy make_proxy_inplace(T&& value) - noexcept(std::is_nothrow_constructible_v, T>) - requires(std::is_constructible_v, T>); ``` -`(1)` Creates a `proxy` object containing a value `p` of type *inplace-ptr<T>*, where `*p` is direct-non-list-initialized with `std::forward(args)...`. +`(1)` Creates a `proxy` object containing a value `p` of type *inplace-ptr<*`std::decay_t`*>*, where `*p` is direct-non-list-initialized with `std::forward(value)`. -`(2)` Creates a `proxy` object containing a value `p` of type *inplace-ptr<T>*, where `*p` is direct-non-list-initialized with `il, std::forward(args)...`. +`(2)` Creates a `proxy` object containing a value `p` of type *inplace-ptr<T>*, where `*p` is direct-non-list-initialized with `std::forward(args)...`. -`(3)` Creates a `proxy` object containing a value `p` of type *inplace-ptr<*`std::decay_t`*>*, where `*p` is direct-non-list-initialized with `std::forward(value)`. +`(3)` Creates a `proxy` object containing a value `p` of type *inplace-ptr<T>*, where `*p` is direct-non-list-initialized with `il, std::forward(args)...`. *Since 3.3.0*: For `(1-3)`, if [`inplace_proxiable_target, F>`](inplace_proxiable_target.md) is `false`, the program is ill-formed and diagnostic messages are generated. diff --git a/docs/spec/make_proxy_shared.md b/docs/spec/make_proxy_shared.md index fd2f5f5..3a50dbd 100644 --- a/docs/spec/make_proxy_shared.md +++ b/docs/spec/make_proxy_shared.md @@ -7,23 +7,23 @@ ```cpp // (1) +template +proxy make_proxy_shared(T&& value); // freestanding-deleted + +// (2) template proxy make_proxy_shared(Args&&... args); // freestanding-deleted -// (2) +// (3) template proxy make_proxy_shared(std::initializer_list il, Args&&... args); // freestanding-deleted - -// (3) -template -proxy make_proxy_shared(T&& value); // freestanding-deleted ``` -`(1)` Equivalent to `return allocate_proxy_shared(std::allocator{}, std::forward(args)...)`. +`(1)` Equivalent to `return allocate_proxy_shared>(std::allocator{}, std::forward(value))`. -`(2)` Equivalent to `return allocate_proxy_shared(std::allocator{}, il, std::forward(args)...)`. +`(2)` Equivalent to `return allocate_proxy_shared(std::allocator{}, std::forward(args)...)`. -`(3)` Equivalent to `return allocate_proxy_shared>(std::allocator{}, std::forward(value))`. +`(3)` Equivalent to `return allocate_proxy_shared(std::allocator{}, il, std::forward(args)...)`. *Since 3.3.0*: For `(1-3)`, if [`proxiable_target, F>`](proxiable_target.md) is `false`, the program is ill-formed and diagnostic messages are generated. diff --git a/include/proxy/v4/detail/core.h b/include/proxy/v4/detail/core.h index 00b8794..8d5930e 100644 --- a/include/proxy/v4/detail/core.h +++ b/include/proxy/v4/detail/core.h @@ -716,8 +716,8 @@ struct meta_storage : facade_traits::meta_storage_base { template class inplace_ptr { public: - template - explicit inplace_ptr(std::in_place_t, Args&&... args) + template + explicit inplace_ptr(const Ignore&, Args&&... args) : value_(std::forward(args)...) {} inplace_ptr() = default; inplace_ptr(const inplace_ptr&) = default; diff --git a/include/proxy/v4/detail/proxy_creation.h b/include/proxy/v4/detail/proxy_creation.h index 6134cc8..2c4cf52 100644 --- a/include/proxy/v4/detail/proxy_creation.h +++ b/include/proxy/v4/detail/proxy_creation.h @@ -30,6 +30,14 @@ template struct is_bitwise_trivially_relocatable> : std::true_type {}; +template +constexpr proxy make_proxy_inplace(T&& value) noexcept( + std::is_nothrow_constructible_v, T>) + requires(std::is_constructible_v, T>) +{ + return proxy{std::in_place_type>>, + std::in_place, std::forward(value)}; +} template constexpr proxy make_proxy_inplace(Args&&... args) noexcept( std::is_nothrow_constructible_v) @@ -47,14 +55,6 @@ constexpr proxy return proxy{std::in_place_type>, std::in_place, il, std::forward(args)...}; } -template -constexpr proxy make_proxy_inplace(T&& value) noexcept( - std::is_nothrow_constructible_v, T>) - requires(std::is_constructible_v, T>) -{ - return proxy{std::in_place_type>>, - std::in_place, std::forward(value)}; -} template constexpr proxy_view make_proxy_view(T& value) noexcept { @@ -107,21 +107,21 @@ class indirect_ptr { }; template -class PRO4D_ENFORCE_EBO allocated_ptr : private alloc_aware, - public indirect_ptr> { +class PRO4D_ENFORCE_EBO wide_ptr : private alloc_aware, + public indirect_ptr> { public: template - allocated_ptr(const Alloc& alloc, Args&&... args) + wide_ptr(const Alloc& alloc, Args&&... args) : alloc_aware(alloc), indirect_ptr>(allocate>( this->alloc, std::in_place, std::forward(args)...)) {} - allocated_ptr(const allocated_ptr& rhs) + wide_ptr(const wide_ptr& rhs) requires(std::is_copy_constructible_v) : alloc_aware(rhs), indirect_ptr>( allocate>(this->alloc, std::in_place, *rhs)) {} - allocated_ptr(allocated_ptr&& rhs) = delete; - ~allocated_ptr() noexcept(std::is_nothrow_destructible_v) { + wide_ptr(wide_ptr&& rhs) = delete; + ~wide_ptr() noexcept(std::is_nothrow_destructible_v) { deallocate(this->alloc, this->ptr_); } }; @@ -279,42 +279,31 @@ class weak_compact_ptr { strong_weak_compact_ptr_storage* ptr_; }; -template -constexpr proxy allocate_proxy_impl(const Alloc& alloc, Args&&... args) { - if constexpr (proxiable, F>) { - return proxy{std::in_place_type>, alloc, - std::forward(args)...}; - } else { - return proxy{std::in_place_type>, alloc, - std::forward(args)...}; - } -} -template -constexpr proxy make_proxy_impl(Args&&... args) { - if constexpr (proxiable, F>) { - return proxy{std::in_place_type>, std::in_place, - std::forward(args)...}; - } else { - return allocate_proxy_impl(std::allocator{}, - std::forward(args)...); - } -} -template -constexpr proxy allocate_proxy_shared_impl(const Alloc& alloc, - Args&&... args) { - if constexpr (std::is_convertible_v, weak_proxy>) { - return proxy{std::in_place_type>, alloc, - std::forward(args)...}; - } else { - return proxy{std::in_place_type>, alloc, - std::forward(args)...}; - } -} -template -constexpr proxy make_proxy_shared_impl(Args&&... args) { - return allocate_proxy_shared_impl(std::allocator{}, - std::forward(args)...); -} +template +struct allocated_ptr_traits : std::type_identity> {}; +template + requires(proxiable, F>) +struct allocated_ptr_traits + : std::type_identity> {}; +template +using allocated_ptr = allocated_ptr_traits::type; + +template +struct owned_ptr_traits : allocated_ptr_traits> {}; +template + requires(proxiable, F>) +struct owned_ptr_traits : std::type_identity> {}; +template +using owned_ptr = owned_ptr_traits::type; + +template +struct shared_ptr_traits : std::type_identity> {}; +template + requires(std::is_convertible_v, weak_proxy>) +struct shared_ptr_traits + : std::type_identity> {}; +template > +using shared_ptr = shared_ptr_traits::type; } // namespace detail @@ -328,7 +317,7 @@ template struct is_bitwise_trivially_relocatable> : std::true_type {}; template requires(is_bitwise_trivially_relocatable_v) -struct is_bitwise_trivially_relocatable> +struct is_bitwise_trivially_relocatable> : std::true_type {}; template struct is_bitwise_trivially_relocatable> @@ -343,52 +332,65 @@ template struct is_bitwise_trivially_relocatable> : std::true_type {}; +template +constexpr proxy allocate_proxy(const Alloc& alloc, T&& value) + requires(std::is_constructible_v, T>) +{ + return proxy{ + std::in_place_type, Alloc>>, + alloc, std::forward(value)}; +} template constexpr proxy allocate_proxy(const Alloc& alloc, Args&&... args) requires(std::is_constructible_v) { - return detail::allocate_proxy_impl(alloc, std::forward(args)...); + return proxy{std::in_place_type>, alloc, + std::forward(args)...}; } template constexpr proxy allocate_proxy(const Alloc& alloc, std::initializer_list il, Args&&... args) requires(std::is_constructible_v&, Args...>) { - return detail::allocate_proxy_impl(alloc, il, - std::forward(args)...); + return proxy{std::in_place_type>, alloc, + il, std::forward(args)...}; } -template -constexpr proxy allocate_proxy(const Alloc& alloc, T&& value) +template +constexpr proxy make_proxy(T&& value) requires(std::is_constructible_v, T>) { - return detail::allocate_proxy_impl>( - alloc, std::forward(value)); + return proxy{std::in_place_type>>, + std::allocator{}, std::forward(value)}; } template constexpr proxy make_proxy(Args&&... args) requires(std::is_constructible_v) { - return detail::make_proxy_impl(std::forward(args)...); + return proxy{std::in_place_type>, + std::allocator{}, std::forward(args)...}; } template constexpr proxy make_proxy(std::initializer_list il, Args&&... args) requires(std::is_constructible_v&, Args...>) { - return detail::make_proxy_impl(il, std::forward(args)...); + return proxy{std::in_place_type>, + std::allocator{}, il, std::forward(args)...}; } -template -constexpr proxy make_proxy(T&& value) + +template +constexpr proxy allocate_proxy_shared(const Alloc& alloc, T&& value) requires(std::is_constructible_v, T>) { - return detail::make_proxy_impl>(std::forward(value)); + return proxy{ + std::in_place_type, Alloc>>, alloc, + std::forward(value)}; } - template constexpr proxy allocate_proxy_shared(const Alloc& alloc, Args&&... args) requires(std::is_constructible_v) { - return detail::allocate_proxy_shared_impl(alloc, - std::forward(args)...); + return proxy{std::in_place_type>, alloc, + std::forward(args)...}; } template constexpr proxy allocate_proxy_shared(const Alloc& alloc, @@ -396,35 +398,30 @@ constexpr proxy allocate_proxy_shared(const Alloc& alloc, Args&&... args) requires(std::is_constructible_v&, Args...>) { - return detail::allocate_proxy_shared_impl(alloc, il, - std::forward(args)...); + return proxy{std::in_place_type>, alloc, + il, std::forward(args)...}; } -template -constexpr proxy allocate_proxy_shared(const Alloc& alloc, T&& value) +template +constexpr proxy make_proxy_shared(T&& value) requires(std::is_constructible_v, T>) { - return detail::allocate_proxy_shared_impl>( - alloc, std::forward(value)); + return proxy{std::in_place_type>>, + std::allocator{}, std::forward(value)}; } template constexpr proxy make_proxy_shared(Args&&... args) requires(std::is_constructible_v) { - return detail::make_proxy_shared_impl(std::forward(args)...); + return proxy{std::in_place_type>, + std::allocator{}, std::forward(args)...}; } template constexpr proxy make_proxy_shared(std::initializer_list il, Args&&... args) requires(std::is_constructible_v&, Args...>) { - return detail::make_proxy_shared_impl(il, std::forward(args)...); -} -template -constexpr proxy make_proxy_shared(T&& value) - requires(std::is_constructible_v, T>) -{ - return detail::make_proxy_shared_impl>( - std::forward(value)); + return proxy{std::in_place_type>, + std::allocator{}, il, std::forward(args)...}; } #endif // __STDC_HOSTED__ diff --git a/tests/proxy_creation_tests.cpp b/tests/proxy_creation_tests.cpp index a16292b..341e2b8 100644 --- a/tests/proxy_creation_tests.cpp +++ b/tests/proxy_creation_tests.cpp @@ -12,7 +12,7 @@ namespace proxy_creation_tests_detail { enum LifetimeModelType { kNone, kInplace, - kAllocated, + kWide, kCompact, kSharedCompact, kStrongCompact @@ -25,8 +25,8 @@ struct LifetimeModelReflector { : Type(LifetimeModelType::kInplace) {} template constexpr explicit LifetimeModelReflector( - std::in_place_type_t>) - : Type(LifetimeModelType::kAllocated) {} + std::in_place_type_t>) + : Type(LifetimeModelType::kWide) {} template constexpr explicit LifetimeModelReflector( std::in_place_type_t>) @@ -293,7 +293,7 @@ TEST(ProxyCreationTests, TestAllocateProxy_DirectAllocator_FromValue) { std::allocator{}, session); ASSERT_TRUE(p.has_value()); ASSERT_EQ(ToString(*p), "Session 2"); - ASSERT_EQ(p.GetLifetimeType(), detail::LifetimeModelType::kAllocated); + ASSERT_EQ(p.GetLifetimeType(), detail::LifetimeModelType::kWide); expected_ops.emplace_back(2, utils::LifetimeOperationType::kCopyConstruction); ASSERT_TRUE(tracker.GetOperations() == expected_ops); @@ -311,7 +311,7 @@ TEST(ProxyCreationTests, TestAllocateProxy_DirectAllocator_InPlace) { std::allocator{}, &tracker); ASSERT_TRUE(p.has_value()); ASSERT_EQ(ToString(*p), "Session 1"); - ASSERT_EQ(p.GetLifetimeType(), detail::LifetimeModelType::kAllocated); + ASSERT_EQ(p.GetLifetimeType(), detail::LifetimeModelType::kWide); expected_ops.emplace_back(1, utils::LifetimeOperationType::kValueConstruction); ASSERT_TRUE(tracker.GetOperations() == expected_ops); @@ -330,7 +330,7 @@ TEST(ProxyCreationTests, std::allocator{}, {1, 2, 3}, &tracker); ASSERT_TRUE(p.has_value()); ASSERT_EQ(ToString(*p), "Session 1"); - ASSERT_EQ(p.GetLifetimeType(), detail::LifetimeModelType::kAllocated); + ASSERT_EQ(p.GetLifetimeType(), detail::LifetimeModelType::kWide); expected_ops.emplace_back( 1, utils::LifetimeOperationType::kInitializerListConstruction); ASSERT_TRUE(tracker.GetOperations() == expected_ops); @@ -351,10 +351,10 @@ TEST(ProxyCreationTests, TestAllocateProxy_DirectAllocator_Lifetime_Copy) { auto p2 = p1; ASSERT_TRUE(p1.has_value()); ASSERT_EQ(ToString(*p1), "Session 1"); - ASSERT_EQ(p1.GetLifetimeType(), detail::LifetimeModelType::kAllocated); + ASSERT_EQ(p1.GetLifetimeType(), detail::LifetimeModelType::kWide); ASSERT_TRUE(p2.has_value()); ASSERT_EQ(ToString(*p2), "Session 2"); - ASSERT_EQ(p2.GetLifetimeType(), detail::LifetimeModelType::kAllocated); + ASSERT_EQ(p2.GetLifetimeType(), detail::LifetimeModelType::kWide); expected_ops.emplace_back(2, utils::LifetimeOperationType::kCopyConstruction); ASSERT_TRUE(tracker.GetOperations() == expected_ops); @@ -377,7 +377,7 @@ TEST(ProxyCreationTests, TestAllocateProxy_DirectAllocator_Lifetime_Move) { ASSERT_FALSE(p1.has_value()); ASSERT_TRUE(p2.has_value()); ASSERT_EQ(ToString(*p2), "Session 1"); - ASSERT_EQ(p2.GetLifetimeType(), detail::LifetimeModelType::kAllocated); + ASSERT_EQ(p2.GetLifetimeType(), detail::LifetimeModelType::kWide); ASSERT_TRUE(tracker.GetOperations() == expected_ops); } expected_ops.emplace_back(1, utils::LifetimeOperationType::kDestruction); @@ -601,7 +601,7 @@ TEST(ProxyCreationTests, TestMakeProxy_WithoutSBO_FromValue) { auto p = pro::make_proxy(session); ASSERT_TRUE(p.has_value()); ASSERT_EQ(ToString(*p), "Session 2"); - ASSERT_EQ(p.GetLifetimeType(), detail::LifetimeModelType::kAllocated); + ASSERT_EQ(p.GetLifetimeType(), detail::LifetimeModelType::kWide); expected_ops.emplace_back(2, utils::LifetimeOperationType::kCopyConstruction); ASSERT_TRUE(tracker.GetOperations() == expected_ops); @@ -618,7 +618,7 @@ TEST(ProxyCreationTests, TestMakeProxy_WithoutSBO_InPlace) { utils::LifetimeTracker::Session>(&tracker); ASSERT_TRUE(p.has_value()); ASSERT_EQ(ToString(*p), "Session 1"); - ASSERT_EQ(p.GetLifetimeType(), detail::LifetimeModelType::kAllocated); + ASSERT_EQ(p.GetLifetimeType(), detail::LifetimeModelType::kWide); expected_ops.emplace_back(1, utils::LifetimeOperationType::kValueConstruction); ASSERT_TRUE(tracker.GetOperations() == expected_ops); @@ -636,7 +636,7 @@ TEST(ProxyCreationTests, TestMakeProxy_WithoutSBO_InPlaceInitializerList) { utils::LifetimeTracker::Session>({1, 2, 3}, &tracker); ASSERT_TRUE(p.has_value()); ASSERT_EQ(ToString(*p), "Session 1"); - ASSERT_EQ(p.GetLifetimeType(), detail::LifetimeModelType::kAllocated); + ASSERT_EQ(p.GetLifetimeType(), detail::LifetimeModelType::kWide); expected_ops.emplace_back( 1, utils::LifetimeOperationType::kInitializerListConstruction); ASSERT_TRUE(tracker.GetOperations() == expected_ops); @@ -656,10 +656,10 @@ TEST(ProxyCreationTests, TestMakeProxy_WithoutSBO_Lifetime_Copy) { auto p2 = p1; ASSERT_TRUE(p1.has_value()); ASSERT_EQ(ToString(*p1), "Session 1"); - ASSERT_EQ(p1.GetLifetimeType(), detail::LifetimeModelType::kAllocated); + ASSERT_EQ(p1.GetLifetimeType(), detail::LifetimeModelType::kWide); ASSERT_TRUE(p2.has_value()); ASSERT_EQ(ToString(*p2), "Session 2"); - ASSERT_EQ(p2.GetLifetimeType(), detail::LifetimeModelType::kAllocated); + ASSERT_EQ(p2.GetLifetimeType(), detail::LifetimeModelType::kWide); expected_ops.emplace_back(2, utils::LifetimeOperationType::kCopyConstruction); ASSERT_TRUE(tracker.GetOperations() == expected_ops); @@ -681,7 +681,7 @@ TEST(ProxyCreationTests, TestMakeProxy_WithoutSBO_Lifetime_Move) { ASSERT_FALSE(p1.has_value()); ASSERT_TRUE(p2.has_value()); ASSERT_EQ(ToString(*p2), "Session 1"); - ASSERT_EQ(p2.GetLifetimeType(), detail::LifetimeModelType::kAllocated); + ASSERT_EQ(p2.GetLifetimeType(), detail::LifetimeModelType::kWide); ASSERT_TRUE(tracker.GetOperations() == expected_ops); } expected_ops.emplace_back(1, utils::LifetimeOperationType::kDestruction);