From 86f63fbd02c28a67a00a4682e58f45866e00c71b Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 21 Nov 2023 19:56:13 +0100 Subject: [PATCH] *_allocator: Make members public A private value_type is a problem for boost small_vector, which instantiates rebind at some point. For example, instantiating small_vector> results in: include/boost/container/allocator_traits.hpp:145:37: error: 'value_type' is a private member of 'traceable_allocator' typedef typename allocator_type::value_type value_type; [...] gc_allocator.h:319:23: note: implicitly declared private here typedef void value_type; I don't see a reason why any of the members should be private, and arguably it violates the Liskov substitution principle. It seems that it was left private by accidental omission. --- include/gc/gc_allocator.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/gc/gc_allocator.h b/include/gc/gc_allocator.h index 34a0f3ab5..fbe16f1f6 100644 --- a/include/gc/gc_allocator.h +++ b/include/gc/gc_allocator.h @@ -170,6 +170,7 @@ class gc_allocator { template<> class gc_allocator { +public: typedef GC_ALCTR_SIZE_T size_type; typedef GC_ALCTR_PTRDIFF_T difference_type; typedef void* pointer; @@ -245,6 +246,7 @@ class gc_allocator_ignore_off_page { template<> class gc_allocator_ignore_off_page { +public: typedef GC_ALCTR_SIZE_T size_type; typedef GC_ALCTR_PTRDIFF_T difference_type; typedef void* pointer; @@ -323,6 +325,7 @@ class traceable_allocator { template<> class traceable_allocator { +public: typedef GC_ALCTR_SIZE_T size_type; typedef GC_ALCTR_PTRDIFF_T difference_type; typedef void* pointer;