From c3a6684c4fade54ffadc9b24b5b89e28f381459f Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 2 Dec 2025 21:47:34 -0500 Subject: [PATCH] Gc.test.cpp expansion. Not working yet --- xo-alloc/utest/GC.test.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/xo-alloc/utest/GC.test.cpp b/xo-alloc/utest/GC.test.cpp index c5245243..3912e8e4 100644 --- a/xo-alloc/utest/GC.test.cpp +++ b/xo-alloc/utest/GC.test.cpp @@ -182,11 +182,23 @@ namespace xo { Nested member1_; }; + template struct MemberType { - MemberType() : ctor_ran_{true} {} - explicit MemberType(const std::vector> & mem2) : member2_{mem2} {} + public: + using allocator_type = Allocator; + using vector_allocator_type = typename std::allocator_traits::template rebind_alloc>; + using vector_type = std::vector, vector_allocator_type>; - std::vector> member2_; + public: + MemberType() : ctor_ran_{true} {} + explicit MemberType(const Allocator & alloc) + : member2_{vector_allocator_type(alloc)}, ctor_ran_{true} {} + + explicit MemberType(const vector_type & mem2) : member2_{mem2}, ctor_ran_{true} {} + MemberType(const vector_type & mem2, const Allocator & alloc) + : member2_{mem2, vector_allocator_type(alloc)}, ctor_ran_{true} {} + + vector_type member2_; std::size_t ctor_ran_ = false; }; }