From c7433dfc5ede497126ca347af93ce8587beeafb0 Mon Sep 17 00:00:00 2001 From: Rodion Malinovsky Date: Wed, 16 Sep 2015 14:53:51 +0300 Subject: [PATCH] Add stack::HasAllocator To check is it possible to expose allocator. --- include/rapidjson/internal/stack.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/rapidjson/internal/stack.h b/include/rapidjson/internal/stack.h index 4b98e38..82f23dd 100644 --- a/include/rapidjson/internal/stack.h +++ b/include/rapidjson/internal/stack.h @@ -134,6 +134,10 @@ public: template T* Bottom() { return (T*)stack_; } + bool HasAllocator() const { + return allocator_ != 0; + } + Allocator& GetAllocator() { RAPIDJSON_ASSERT(allocator_); return *allocator_;