summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-01-21 13:35:23 +0000
committerMaxime Coste <frrrwww@gmail.com>2015-01-21 13:35:23 +0000
commitb2d5b9ca5f710b1da849e0f94e8f16dadee11139 (patch)
tree014a1b99c61b2338f881e2d6a90b5bc85908b97b /src
parent5383cece3ec845be9e41360a404cee8b9c8037ce (diff)
Try to fix travis compilation errors
Diffstat (limited to 'src')
-rw-r--r--src/memory.hh13
-rw-r--r--src/unordered_map.hh2
-rw-r--r--src/vector.hh2
3 files changed, 11 insertions, 6 deletions
diff --git a/src/memory.hh b/src/memory.hh
index 163dd76c..3c45f392 100644
--- a/src/memory.hh
+++ b/src/memory.hh
@@ -132,7 +132,7 @@ bool operator!=(const Allocator<T1, d1>& lhs, const Allocator<T2, d2>& rhs)
template<typename T>
struct TypeDomain
{
- static constexpr MemoryDomain domain = TypeDomain::helper((T*)nullptr);
+ static constexpr MemoryDomain domain() { return TypeDomain<T>::helper((T*)nullptr); }
private:
template<typename U> static decltype(U::Domain) constexpr helper(U*) { return U::Domain; }
static constexpr MemoryDomain helper(...) { return MemoryDomain::Undefined; }
@@ -141,16 +141,21 @@ private:
template<MemoryDomain d>
struct UseMemoryDomain
{
- static constexpr MemoryDomain domain = d;
+ static constexpr MemoryDomain Domain = d;
static void* operator new(size_t size)
{
- on_alloc(domain, size);
+ on_alloc(Domain, size);
return ::operator new(size);
}
+ static void* operator new(size_t size, void* ptr)
+ {
+ return ::operator new(size, ptr);
+ }
+
static void operator delete(void* ptr, size_t size)
{
- on_dealloc(domain, size);
+ on_dealloc(Domain, size);
::operator delete(ptr);
}
};
diff --git a/src/unordered_map.hh b/src/unordered_map.hh
index 2c54a0da..13246fac 100644
--- a/src/unordered_map.hh
+++ b/src/unordered_map.hh
@@ -9,7 +9,7 @@
namespace Kakoune
{
-template<typename Key, typename Value, MemoryDomain domain = TypeDomain<Key>::domain>
+template<typename Key, typename Value, MemoryDomain domain = TypeDomain<Key>::domain()>
using UnorderedMap = std::unordered_map<Key, Value, Hash<Key>, std::equal_to<Key>,
Allocator<std::pair<const Key, Value>, domain>>;
diff --git a/src/vector.hh b/src/vector.hh
index db137b24..c8cc9d08 100644
--- a/src/vector.hh
+++ b/src/vector.hh
@@ -8,7 +8,7 @@
namespace Kakoune
{
-template<typename T, MemoryDomain domain = TypeDomain<T>::domain>
+template<typename T, MemoryDomain domain = TypeDomain<T>::domain()>
using Vector = std::vector<T, Allocator<T, domain>>;
}