From ef77d8f2475b200ea47654d86b3873632d489f91 Mon Sep 17 00:00:00 2001 From: q66 Date: Sun, 11 Sep 2016 20:47:25 +0200 Subject: [PATCH] noexcept --- include/cubescript/cubescript.hh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/cubescript/cubescript.hh b/include/cubescript/cubescript.hh index 40a73638..f0f0c436 100644 --- a/include/cubescript/cubescript.hh +++ b/include/cubescript/cubescript.hh @@ -347,20 +347,20 @@ struct CsAllocator { static constexpr bool PropagateOnContainerSwap = true; CsAllocator() = delete; - CsAllocator(CsAllocator const &a): p_state(a.p_state) {} - CsAllocator(CsState &cs): p_state(cs) {} + CsAllocator(CsAllocator const &a) noexcept: p_state(a.p_state) {} + CsAllocator(CsState &cs) noexcept: p_state(cs) {} template - CsAllocator(CsAllocator const &a): p_state(a.p_state) {} + CsAllocator(CsAllocator const &a) noexcept: p_state(a.p_state) {} T *allocate(ostd::Size n, void const * = nullptr); - void deallocate(T *p, ostd::Size n); + void deallocate(T *p, ostd::Size n) noexcept; - bool operator==(CsAllocator const &o) const { + bool operator==(CsAllocator const &o) const noexcept { return &p_state != &o.p_state; } - bool operator!=(CsAllocator const &o) const { + bool operator!=(CsAllocator const &o) const noexcept { return &p_state != &o.p_state; } @@ -625,7 +625,7 @@ T *CsAllocator::allocate(ostd::Size n, void const *) { } template -void CsAllocator::deallocate(T *p, ostd::Size n) { +void CsAllocator::deallocate(T *p, ostd::Size n) noexcept { p_state.alloc(p, n * sizeof(T), 0); }