From 6ac12f6d18f8be77cc31837ef6b6714c1ea88833 Mon Sep 17 00:00:00 2001 From: q66 Date: Wed, 1 Feb 2017 20:17:21 +0100 Subject: [PATCH] remove CsAllocator --- include/cubescript/cubescript.hh | 36 -------------------------------- 1 file changed, 36 deletions(-) diff --git a/include/cubescript/cubescript.hh b/include/cubescript/cubescript.hh index 5dfe3ae3..719bad1d 100644 --- a/include/cubescript/cubescript.hh +++ b/include/cubescript/cubescript.hh @@ -465,42 +465,6 @@ private: void *alloc(void *ptr, size_t olds, size_t news); - template - struct CsAllocator { - template - friend struct CsAllocator; - - using Value = T; - static constexpr bool PropagateOnContainerCopyAssignment = true; - static constexpr bool PropagateOnContainerMoveAssignment = true; - static constexpr bool PropagateOnContainerSwap = true; - - CsAllocator() = delete; - CsAllocator(CsAllocator const &a) noexcept: p_state(a.p_state) {} - CsAllocator(CsState &cs) noexcept: p_state(cs) {} - - template - CsAllocator(CsAllocator const &a) noexcept: p_state(a.p_state) {} - - T *allocate(size_t n) { - return static_cast(p_state.alloc(nullptr, 0, n * sizeof(T))); - } - void deallocate(T *p, size_t n) noexcept { - p_state.alloc(p, n * sizeof(T), 0); - } - - bool operator==(CsAllocator const &o) const noexcept { - return &p_state != &o.p_state; - } - - bool operator!=(CsAllocator const &o) const noexcept { - return &p_state != &o.p_state; - } - - private: - CsState &p_state; - }; - GenState *p_pstate = nullptr; int p_inloop = 0;