summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-08-12 15:49:38 +0700
committerMaxime Coste <mawww@kakoune.org>2017-08-12 15:49:38 +0700
commit407c84666cf0d94148ded5f6c2ea6a44fa27acfc (patch)
treefd6d1d0c1464a15938be59d50d5cf0190359be6c
parenta61c51dfc6831e5e73344f01bacf6b0f9436eafa (diff)
Remove redundant types inside Kakoune::Allocator
-rw-r--r--src/memory.hh22
1 files 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<typename T, MemoryDomain domain>
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<typename U>
@@ -117,27 +110,16 @@ struct Allocator
on_dealloc(domain, size);
::operator delete(ptr);
}
-
- template<class U, class... Args>
- [[gnu::always_inline]]
- void construct(U* p, Args&&... args)
- {
- new ((void*)p) U(std::forward<Args>(args)...);
- }
-
- template<class U>
- [[gnu::always_inline]]
- void destroy(U* p) { p->~U(); }
};
template<typename T1, MemoryDomain d1, typename T2, MemoryDomain d2>
-bool operator==(const Allocator<T1, d1>& lhs, const Allocator<T2, d2>& rhs)
+constexpr bool operator==(const Allocator<T1, d1>&, const Allocator<T2, d2>&)
{
return d1 == d2;
}
template<typename T1, MemoryDomain d1, typename T2, MemoryDomain d2>
-bool operator!=(const Allocator<T1, d1>& lhs, const Allocator<T2, d2>& rhs)
+constexpr bool operator!=(const Allocator<T1, d1>&, const Allocator<T2, d2>&)
{
return d1 != d2;
}