aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-09-12 04:30:52 -0700
committerChris Robinson <[email protected]>2019-09-12 04:30:52 -0700
commitb71eb4dafd9e525020a5f2cd869d671fb3e8e5bd (patch)
treeccec44eee42b120aa810ffc5ec28c00a2055001e
parent6699f3cf1cd563814ec5c4513613d588a05e2941 (diff)
Don't use [[nodiscard]] in C++11
To silence some warnings in older compilers, and fix an error with newer MSVC.
-rw-r--r--common/almalloc.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/common/almalloc.h b/common/almalloc.h
index 37b57d2b..d144ca35 100644
--- a/common/almalloc.h
+++ b/common/almalloc.h
@@ -42,7 +42,7 @@ struct FamCount { size_t mCount; };
return ret; \
throw std::bad_alloc(); \
} \
- void operator delete(void *block, FamCount /*fam*/) { al_free(block); } \
+ void operator delete(void *block, FamCount) { al_free(block); } \
void operator delete(void *block) noexcept { al_free(block); }
@@ -61,12 +61,12 @@ struct allocator {
};
allocator() = default;
- template<typename U>
- constexpr allocator(const allocator<U>&) noexcept { }
+ template<typename U, std::size_t N>
+ constexpr allocator(const allocator<U,N>&) noexcept { }
- [[nodiscard]] T *allocate(std::size_t n)
+ T *allocate(std::size_t n)
{
- if(n > std::numeric_limits<std::size_t>::max() / sizeof(T)) throw std::bad_alloc();
+ if(n > std::numeric_limits<std::size_t>::max()/sizeof(T)) throw std::bad_alloc();
if(auto p = static_cast<T*>(al_malloc(alignment, n*sizeof(T)))) return p;
throw std::bad_alloc();
}