From 407c84666cf0d94148ded5f6c2ea6a44fa27acfc Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 12 Aug 2017 15:49:38 +0700 Subject: [PATCH] Remove redundant types inside Kakoune::Allocator --- src/memory.hh | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/memory.hh b/src/memory.hh index fe6f70ea..b25e687d 100644 --- a/src/memory.hh +++ b/src/memory.hh @@ -89,13 +89,6 @@ template struct Allocator { using value_type = T; - // TODO: remove that once we have a c++11 compliant stdlib - using pointer = T*; - using const_pointer = const T*; - using reference = T&; - using const_reference = const T&; - using size_type = std::size_t; - using difference_type = std::ptrdiff_t; Allocator() = default; template @@ -117,27 +110,16 @@ struct Allocator on_dealloc(domain, size); ::operator delete(ptr); } - - template - [[gnu::always_inline]] - void construct(U* p, Args&&... args) - { - new ((void*)p) U(std::forward(args)...); - } - - template - [[gnu::always_inline]] - void destroy(U* p) { p->~U(); } }; template -bool operator==(const Allocator& lhs, const Allocator& rhs) +constexpr bool operator==(const Allocator&, const Allocator&) { return d1 == d2; } template -bool operator!=(const Allocator& lhs, const Allocator& rhs) +constexpr bool operator!=(const Allocator&, const Allocator&) { return d1 != d2; }