|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r82870 - in trunk: boost/atomic boost/atomic/detail libs/atomic/test
From: tim_at_[hidden]
Date: 2013-02-14 07:32:43
Author: timblechmann
Date: 2013-02-14 07:32:41 EST (Thu, 14 Feb 2013)
New Revision: 82870
URL: http://svn.boost.org/trac/boost/changeset/82870
Log:
atomic: adapt for constexpr and noexcept
Signed-off-by: Tim Blechmann <tim_at_[hidden]>
Text files modified:
trunk/boost/atomic/atomic.hpp | 15 +
trunk/boost/atomic/detail/base.hpp | 136 ++++++++++--------
trunk/boost/atomic/detail/cas32strong.hpp | 138 +++++++++---------
trunk/boost/atomic/detail/cas32weak.hpp | 163 +++++++++++-----------
trunk/boost/atomic/detail/cas64strong.hpp | 80 +++++-----
trunk/boost/atomic/detail/gcc-alpha.hpp | 41 ++--
trunk/boost/atomic/detail/gcc-armv6plus.hpp | 7
trunk/boost/atomic/detail/gcc-cas.hpp | 7
trunk/boost/atomic/detail/gcc-ppc.hpp | 294 ++++++++++++++++++++--------------------
trunk/boost/atomic/detail/gcc-sparcv9.hpp | 199 +++++++++++++-------------
trunk/boost/atomic/detail/gcc-x86.hpp | 242 ++++++++++++++++----------------
trunk/boost/atomic/detail/linux-arm.hpp | 7
trunk/boost/atomic/detail/windows.hpp | 198 +++++++++++++-------------
trunk/libs/atomic/test/api_test_helpers.hpp | 11 +
trunk/libs/atomic/test/native_api.cpp | 6
15 files changed, 790 insertions(+), 754 deletions(-)
Modified: trunk/boost/atomic/atomic.hpp
==============================================================================
--- trunk/boost/atomic/atomic.hpp (original)
+++ trunk/boost/atomic/atomic.hpp 2013-02-14 07:32:41 EST (Thu, 14 Feb 2013)
@@ -2,6 +2,7 @@
#define BOOST_ATOMIC_ATOMIC_HPP
// Copyright (c) 2011 Helge Bahmann
+// Copyright (c) 2013 Tim Blechmann
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
@@ -88,17 +89,23 @@
typedef T value_type;
typedef atomics::detail::base_atomic<T, typename atomics::detail::classify<T>::type, atomics::detail::storage_size_of<T>::value, boost::is_signed<T>::value > super;
public:
- atomic(void) : super() {}
- explicit atomic(const value_type & v) : super(v) {}
+ atomic(void) BOOST_NOEXCEPT : super() {}
+ BOOST_CONSTEXPR atomic(value_type v) BOOST_NOEXCEPT: super(v) {}
- atomic & operator=(value_type v) volatile
+ atomic & operator=(value_type v) volatile BOOST_NOEXCEPT
{
super::operator=(v);
return *const_cast<atomic *>(this);
}
+
private:
+#ifdef BOOST_NO_CXX11_DELETED_FUNCTIONS
atomic(const atomic &) /* =delete */ ;
- atomic & operator=(const atomic &) /* =delete */ ;
+ atomic & operator=(const atomic &) volatile /* =delete */ ;
+#else
+ atomic(const atomic &) = delete;
+ atomic & operator=(const atomic &) volatile = delete;
+#endif
};
typedef atomic<char> atomic_char;
Modified: trunk/boost/atomic/detail/base.hpp
==============================================================================
--- trunk/boost/atomic/detail/base.hpp (original)
+++ trunk/boost/atomic/detail/base.hpp 2013-02-14 07:32:41 EST (Thu, 14 Feb 2013)
@@ -2,6 +2,7 @@
#define BOOST_ATOMIC_DETAIL_BASE_HPP
// Copyright (c) 2009 Helge Bahmann
+// Copyright (c) 2013 Tim Blechmann
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
@@ -23,13 +24,13 @@
#endif
#define BOOST_ATOMIC_DECLARE_BASE_OPERATORS \
- operator value_type(void) volatile const \
+ operator value_type(void) volatile const BOOST_NOEXCEPT \
{ \
return load(memory_order_seq_cst); \
} \
\
this_type & \
- operator=(value_type v) volatile \
+ operator=(value_type v) volatile BOOST_NOEXCEPT \
{ \
store(v, memory_order_seq_cst); \
return *const_cast<this_type *>(this); \
@@ -39,7 +40,7 @@
compare_exchange_strong( \
value_type & expected, \
value_type desired, \
- memory_order order = memory_order_seq_cst) volatile \
+ memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT \
{ \
return compare_exchange_strong(expected, desired, order, calculate_failure_order(order)); \
} \
@@ -48,7 +49,7 @@
compare_exchange_weak( \
value_type & expected, \
value_type desired, \
- memory_order order = memory_order_seq_cst) volatile \
+ memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT \
{ \
return compare_exchange_weak(expected, desired, order, calculate_failure_order(order)); \
} \
@@ -56,56 +57,56 @@
#define BOOST_ATOMIC_DECLARE_ADDITIVE_OPERATORS \
value_type \
- operator++(int) volatile \
+ operator++(int) volatile BOOST_NOEXCEPT \
{ \
return fetch_add(1); \
} \
\
value_type \
- operator++(void) volatile \
+ operator++(void) volatile BOOST_NOEXCEPT \
{ \
return fetch_add(1) + 1; \
} \
\
value_type \
- operator--(int) volatile \
+ operator--(int) volatile BOOST_NOEXCEPT \
{ \
return fetch_sub(1); \
} \
\
value_type \
- operator--(void) volatile \
+ operator--(void) volatile BOOST_NOEXCEPT \
{ \
return fetch_sub(1) - 1; \
} \
\
value_type \
- operator+=(difference_type v) volatile \
+ operator+=(difference_type v) volatile BOOST_NOEXCEPT \
{ \
return fetch_add(v) + v; \
} \
\
value_type \
- operator-=(difference_type v) volatile \
+ operator-=(difference_type v) volatile BOOST_NOEXCEPT \
{ \
return fetch_sub(v) - v; \
} \
#define BOOST_ATOMIC_DECLARE_BIT_OPERATORS \
value_type \
- operator&=(difference_type v) volatile \
+ operator&=(difference_type v) volatile BOOST_NOEXCEPT \
{ \
return fetch_and(v) & v; \
} \
\
value_type \
- operator|=(difference_type v) volatile \
+ operator|=(difference_type v) volatile BOOST_NOEXCEPT \
{ \
return fetch_or(v) | v; \
} \
\
value_type \
- operator^=(difference_type v) volatile \
+ operator^=(difference_type v) volatile BOOST_NOEXCEPT\
{ \
return fetch_xor(v) ^ v; \
} \
@@ -142,29 +143,32 @@
typedef base_atomic this_type;
typedef T value_type;
typedef lockpool::scoped_lock guard_type;
+ typedef char storage_type[sizeof(value_type)];
+
public:
base_atomic(void) {}
- explicit base_atomic(const value_type & v)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT:
+ v_(v)
+ {}
void
- store(value_type const& v, memory_order /*order*/ = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
- guard_type guard(const_cast<char *>(v_));
+ char * storage = storage_ptr();
+ guard_type guard(storage);
- memcpy(const_cast<char *>(v_), &v, sizeof(value_type));
+ memcpy(storage, &v, sizeof(value_type));
}
value_type
- load(memory_order /*order*/ = memory_order_seq_cst) volatile const
+ load(memory_order /*order*/ = memory_order_seq_cst) volatile const BOOST_NOEXCEPT
{
- guard_type guard(const_cast<const char *>(v_));
+ char * storage = storage_ptr();
+ guard_type guard(storage);
value_type v;
- memcpy(&v, const_cast<const char *>(v_), sizeof(value_type));
+ memcpy(&v, storage, sizeof(value_type));
return v;
}
@@ -173,15 +177,16 @@
value_type & expected,
value_type const& desired,
memory_order /*success_order*/,
- memory_order /*failure_order*/) volatile
+ memory_order /*failure_order*/) volatile BOOST_NOEXCEPT
{
- guard_type guard(const_cast<char *>(v_));
+ char * storage = storage_ptr();
+ guard_type guard(storage);
- if (memcmp(const_cast<char *>(v_), &expected, sizeof(value_type)) == 0) {
- memcpy(const_cast<char *>(v_), &desired, sizeof(value_type));
+ if (memcmp(storage, &expected, sizeof(value_type)) == 0) {
+ memcpy(storage, &desired, sizeof(value_type));
return true;
} else {
- memcpy(&expected, const_cast<char *>(v_), sizeof(value_type));
+ memcpy(&expected, storage, sizeof(value_type));
return false;
}
}
@@ -191,35 +196,42 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- exchange(value_type const& v, memory_order /*order*/=memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order /*order*/=memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
- guard_type guard(const_cast<char *>(v_));
+ char * storage = storage_ptr();
+ guard_type guard(storage);
value_type tmp;
- memcpy(&tmp, const_cast<char *>(v_), sizeof(value_type));
+ memcpy(&tmp, storage, sizeof(value_type));
- memcpy(const_cast<char *>(v_), &v, sizeof(value_type));
+ memcpy(storage, &v, sizeof(value_type));
return tmp;
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return false;
}
BOOST_ATOMIC_DECLARE_BASE_OPERATORS
private:
+ char * storage_ptr() volatile const BOOST_NOEXCEPT
+ {
+ const char volatile * ptr = reinterpret_cast<const char volatile *>(&v_);
+ return const_cast<char *>(ptr);
+ }
+
base_atomic(const base_atomic &) /* = delete */ ;
void operator=(const base_atomic &) /* = delete */ ;
- char v_[sizeof(value_type)];
+ T v_;
};
template<typename T, unsigned int Size, bool Sign>
@@ -230,11 +242,11 @@
typedef T difference_type;
typedef lockpool::scoped_lock guard_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile
+ store(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
@@ -242,7 +254,7 @@
}
value_type
- load(memory_order /*order*/ = memory_order_seq_cst) const volatile
+ load(memory_order /*order*/ = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
@@ -251,7 +263,7 @@
}
value_type
- exchange(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
@@ -263,7 +275,7 @@
bool
compare_exchange_strong(value_type & expected, value_type desired,
memory_order /*success_order*/,
- memory_order /*failure_order*/) volatile
+ memory_order /*failure_order*/) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
@@ -279,13 +291,13 @@
bool
compare_exchange_weak(value_type & expected, value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_add(difference_type v, memory_order /*order*/ = memory_order_seq_cst) volatile
+ fetch_add(difference_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
@@ -295,7 +307,7 @@
}
value_type
- fetch_sub(difference_type v, memory_order /*order*/ = memory_order_seq_cst) volatile
+ fetch_sub(difference_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
@@ -305,7 +317,7 @@
}
value_type
- fetch_and(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
@@ -315,7 +327,7 @@
}
value_type
- fetch_or(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
@@ -325,7 +337,7 @@
}
value_type
- fetch_xor(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
@@ -335,7 +347,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return false;
}
@@ -355,18 +367,18 @@
typedef ptrdiff_t difference_type;
typedef lockpool::scoped_lock guard_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile
+ store(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
v_ = v;
}
value_type
- load(memory_order /*order*/ = memory_order_seq_cst) const volatile
+ load(memory_order /*order*/ = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
@@ -375,7 +387,7 @@
}
value_type
- exchange(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
@@ -387,7 +399,7 @@
bool
compare_exchange_strong(value_type & expected, value_type desired,
memory_order /*success_order*/,
- memory_order /*failure_order*/) volatile
+ memory_order /*failure_order*/) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
@@ -403,12 +415,12 @@
bool
compare_exchange_weak(value_type & expected, value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
- value_type fetch_add(difference_type v, memory_order /*order*/ = memory_order_seq_cst) volatile
+ value_type fetch_add(difference_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
@@ -427,7 +439,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return false;
}
@@ -446,18 +458,18 @@
typedef void * value_type;
typedef lockpool::scoped_lock guard_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile
+ store(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
v_ = v;
}
value_type
- load(memory_order /*order*/ = memory_order_seq_cst) const volatile
+ load(memory_order /*order*/ = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
@@ -466,7 +478,7 @@
}
value_type
- exchange(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
@@ -478,7 +490,7 @@
bool
compare_exchange_strong(value_type & expected, value_type desired,
memory_order /*success_order*/,
- memory_order /*failure_order*/) volatile
+ memory_order /*failure_order*/) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
@@ -494,13 +506,13 @@
bool
compare_exchange_weak(value_type & expected, value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return false;
}
Modified: trunk/boost/atomic/detail/cas32strong.hpp
==============================================================================
--- trunk/boost/atomic/detail/cas32strong.hpp (original)
+++ trunk/boost/atomic/detail/cas32strong.hpp 2013-02-14 07:32:41 EST (Thu, 14 Feb 2013)
@@ -6,6 +6,8 @@
// http://www.boost.org/LICENSE_1_0.txt)
//
// Copyright (c) 2011 Helge Bahmann
+// Copyright (c) 2013 Tim Blechmann
+
// Build 8-, 16- and 32-bit atomic operations from
// a platform_cmpxchg32_strong primitive.
@@ -33,11 +35,11 @@
typedef T difference_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
const_cast<volatile storage_type &>(v_) = v;
@@ -53,7 +55,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -66,7 +68,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
@@ -76,7 +78,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
@@ -96,7 +98,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -105,7 +107,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -114,7 +116,7 @@
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -123,7 +125,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -132,7 +134,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -160,11 +162,11 @@
typedef T difference_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
const_cast<volatile storage_type &>(v_) = v;
@@ -180,7 +182,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -193,7 +195,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
@@ -203,7 +205,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
@@ -223,7 +225,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -232,7 +234,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -241,7 +243,7 @@
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -250,7 +252,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -259,7 +261,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -286,11 +288,11 @@
typedef T value_type;
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
const_cast<volatile value_type &>(v_) = v;
@@ -306,7 +308,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -319,7 +321,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
@@ -329,7 +331,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
@@ -345,7 +347,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -354,7 +356,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -363,7 +365,7 @@
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -372,7 +374,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -381,7 +383,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -410,11 +412,11 @@
typedef void * value_type;
typedef ptrdiff_t difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
const_cast<volatile value_type &>(v_) = v;
@@ -430,7 +432,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -443,7 +445,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
@@ -453,7 +455,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
@@ -469,7 +471,7 @@
}
value_type
- fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -478,7 +480,7 @@
}
value_type
- fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -505,11 +507,11 @@
typedef T * value_type;
typedef ptrdiff_t difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
const_cast<volatile value_type &>(v_) = v;
@@ -525,7 +527,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -538,7 +540,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
@@ -548,7 +550,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
@@ -564,7 +566,7 @@
}
value_type
- fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -573,7 +575,7 @@
}
value_type
- fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -602,14 +604,14 @@
typedef T value_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type const& v)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type const& v) BOOST_NOEXCEPT:
+ v_(*reinterpret_cast<storage_type*>(&v))
+ {}
+
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) ) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -630,7 +632,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) ) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -643,7 +645,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) ) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
@@ -653,7 +655,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) ) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -691,14 +693,14 @@
typedef T value_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type const& v)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type const& v) BOOST_NOEXCEPT:
+ v_(*reinterpret_cast<storage_type*>(&v))
+ {}
+
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) ) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -719,7 +721,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) ) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -732,7 +734,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
@@ -742,7 +744,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
@@ -781,14 +783,14 @@
typedef T value_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type const& v) : v_(0)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type const& v) BOOST_NOEXCEPT:
+ v_(*reinterpret_cast<storage_type*>(&v))
+ {}
+
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -809,7 +811,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -822,7 +824,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
@@ -832,7 +834,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
Modified: trunk/boost/atomic/detail/cas32weak.hpp
==============================================================================
--- trunk/boost/atomic/detail/cas32weak.hpp (original)
+++ trunk/boost/atomic/detail/cas32weak.hpp 2013-02-14 07:32:41 EST (Thu, 14 Feb 2013)
@@ -6,6 +6,8 @@
// http://www.boost.org/LICENSE_1_0.txt)
//
// Copyright (c) 2011 Helge Bahmann
+// Copyright (c) 2013 Tim Blechmann
+
#include <cstddef>
#include <boost/cstdint.hpp>
@@ -30,11 +32,11 @@
typedef T difference_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
const_cast<volatile storage_type &>(v_) = v;
@@ -42,7 +44,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -50,7 +52,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -63,7 +65,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
@@ -87,7 +89,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
for(;;) {
value_type tmp = expected;
@@ -101,7 +103,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -110,7 +112,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -119,7 +121,7 @@
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -128,7 +130,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -137,7 +139,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -146,7 +148,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -165,11 +167,11 @@
typedef T difference_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
const_cast<volatile storage_type &>(v_) = v;
@@ -177,7 +179,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -185,7 +187,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -198,7 +200,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
@@ -222,7 +224,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
for(;;) {
value_type tmp = expected;
@@ -236,7 +238,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -245,7 +247,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -254,7 +256,7 @@
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -263,7 +265,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -272,7 +274,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -281,7 +283,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -299,11 +301,11 @@
typedef T value_type;
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
const_cast<volatile value_type &>(v_) = v;
@@ -311,7 +313,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
@@ -319,7 +321,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -332,7 +334,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
@@ -352,7 +354,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
for(;;) {
value_type tmp = expected;
@@ -366,7 +368,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -375,7 +377,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -384,7 +386,7 @@
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -393,7 +395,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -402,7 +404,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -411,7 +413,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -431,11 +433,11 @@
typedef void * value_type;
typedef ptrdiff_t difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
const_cast<volatile value_type &>(v_) = v;
@@ -443,7 +445,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
@@ -451,7 +453,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -464,7 +466,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
@@ -484,7 +486,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
for(;;) {
value_type tmp = expected;
@@ -498,7 +500,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -516,11 +518,11 @@
typedef T * value_type;
typedef ptrdiff_t difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
const_cast<volatile value_type &>(v_) = v;
@@ -528,7 +530,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
@@ -536,7 +538,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -549,7 +551,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
@@ -569,7 +571,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
for(;;) {
value_type tmp = expected;
@@ -583,7 +585,7 @@
}
value_type
- fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -592,7 +594,7 @@
}
value_type
- fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -601,7 +603,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -621,14 +623,13 @@
typedef T value_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type const& v) : v_(0)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type const& v) BOOST_NOEXCEPT:
+ v_(*reinterpret_cast<storage_type*>(&v))
+ {}
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -638,7 +639,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
storage_type tmp = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -649,7 +650,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -662,7 +663,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -687,7 +688,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
for(;;) {
value_type tmp = expected;
@@ -701,7 +702,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -719,14 +720,13 @@
typedef T value_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type const& v) : v_(0)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type const& v) BOOST_NOEXCEPT:
+ v_(*reinterpret_cast<storage_type*>(&v))
+ {}
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -736,7 +736,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
storage_type tmp = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -747,7 +747,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -760,7 +760,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -785,7 +785,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
for(;;) {
value_type tmp = expected;
@@ -799,7 +799,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -817,14 +817,13 @@
typedef T value_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type const& v) : v_(0)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type const& v) BOOST_NOEXCEPT:
+ v_(*reinterpret_cast<storage_type*>(&v))
+ {}
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -834,7 +833,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
storage_type tmp = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -845,7 +844,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -858,7 +857,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -883,7 +882,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
for(;;) {
value_type tmp = expected;
@@ -897,7 +896,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
Modified: trunk/boost/atomic/detail/cas64strong.hpp
==============================================================================
--- trunk/boost/atomic/detail/cas64strong.hpp (original)
+++ trunk/boost/atomic/detail/cas64strong.hpp 2013-02-14 07:32:41 EST (Thu, 14 Feb 2013)
@@ -6,6 +6,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//
// Copyright (c) 2011 Helge Bahmann
+// Copyright (c) 2013 Tim Blechmann
// Build 64-bit atomic operation from platform_cmpxchg64_strong
// primitive. It is assumed that 64-bit loads/stores are not
@@ -33,11 +34,11 @@
typedef T value_type;
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
platform_store64(v, &v_);
@@ -45,7 +46,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = platform_load64(&v_);
platform_fence_after_load(order);
@@ -53,7 +54,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -66,7 +67,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
@@ -76,7 +77,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
@@ -92,7 +93,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -101,7 +102,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -110,7 +111,7 @@
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -119,7 +120,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -128,7 +129,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -137,7 +138,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -157,11 +158,11 @@
typedef void * value_type;
typedef ptrdiff_t difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
platform_store64(v, &v_);
@@ -169,7 +170,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = platform_load64(&v_);
platform_fence_after_load(order);
@@ -177,7 +178,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -190,7 +191,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
@@ -200,7 +201,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
@@ -216,7 +217,7 @@
}
value_type
- fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -225,7 +226,7 @@
}
value_type
- fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -234,7 +235,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -252,11 +253,11 @@
typedef T * value_type;
typedef ptrdiff_t difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
platform_store64(v, &v_);
@@ -264,7 +265,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = platform_load64(&v_);
platform_fence_after_load(order);
@@ -272,7 +273,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -285,7 +286,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
@@ -295,7 +296,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
@@ -311,7 +312,7 @@
}
value_type
- fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -320,7 +321,7 @@
}
value_type
- fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -329,7 +330,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -349,14 +350,13 @@
typedef T value_type;
typedef uint64_t storage_type;
public:
- explicit base_atomic(value_type const& v) : v_(0)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT:
+ v_(*reinterpret_cast<storage_type*>(&v))
+ {}
base_atomic(void) {}
void
- store(value_type const& value, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& value, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type value_s = 0;
memcpy(&value_s, &value, sizeof(value_s));
@@ -366,7 +366,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
storage_type value_s = platform_load64(&v_);
platform_fence_after_load(order);
@@ -376,7 +376,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
@@ -389,7 +389,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
@@ -399,7 +399,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -419,7 +419,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
Modified: trunk/boost/atomic/detail/gcc-alpha.hpp
==============================================================================
--- trunk/boost/atomic/detail/gcc-alpha.hpp (original)
+++ trunk/boost/atomic/detail/gcc-alpha.hpp 2013-02-14 07:32:41 EST (Thu, 14 Feb 2013)
@@ -2,6 +2,7 @@
#define BOOST_ATOMIC_DETAIL_GCC_ALPHA_HPP
// Copyright (c) 2009 Helge Bahmann
+// Copyright (c) 2013 Tim Blechmann
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
@@ -90,15 +91,15 @@
class atomic_alpha_32 {
public:
typedef T integral_type;
- explicit atomic_alpha_32(T v) : i(v) {}
+ BOOST_CONSTEXPR atomic_alpha_32(T v) BOOST_NOEXCEPT: i(v) {}
atomic_alpha_32() {}
- T load(memory_order order=memory_order_seq_cst) const volatile
+ T load(memory_order order=memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
T v=*reinterpret_cast<volatile const int *>(&i);
fence_after(order);
return v;
}
- void store(T v, memory_order order=memory_order_seq_cst) volatile
+ void store(T v, memory_order order=memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
fence_before(order);
*reinterpret_cast<volatile int *>(&i)=(int)v;
@@ -107,7 +108,7 @@
T &expected,
T desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
fence_before(success_order);
int current, success;
@@ -133,9 +134,9 @@
return desired;
}
- bool is_lock_free(void) const volatile {return true;}
+ bool is_lock_free(void) const volatile BOOST_NOEXCEPT {return true;}
protected:
- inline T fetch_add_var(T c, memory_order order) volatile
+ inline T fetch_add_var(T c, memory_order order) volatile BOOST_NOEXCEPT
{
fence_before(order);
T original, modified;
@@ -156,7 +157,7 @@
fence_after(order);
return original;
}
- inline T fetch_inc(memory_order order) volatile
+ inline T fetch_inc(memory_order order) volatile BOOST_NOEXCEPT
{
fence_before(order);
int original, modified;
@@ -177,7 +178,7 @@
fence_after(order);
return original;
}
- inline T fetch_dec(memory_order order) volatile
+ inline T fetch_dec(memory_order order) volatile BOOST_NOEXCEPT
{
fence_before(order);
int original, modified;
@@ -206,7 +207,7 @@
class atomic_alpha_64 {
public:
typedef T integral_type;
- explicit atomic_alpha_64(T v) : i(v) {}
+ BOOST_CONSTEXPR atomic_alpha_64(T v) BOOST_NOEXCEPT: i(v) {}
atomic_alpha_64() {}
T load(memory_order order=memory_order_seq_cst) const volatile
{
@@ -214,7 +215,7 @@
fence_after(order);
return v;
}
- void store(T v, memory_order order=memory_order_seq_cst) volatile
+ void store(T v, memory_order order=memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
fence_before(order);
*reinterpret_cast<volatile T *>(&i)=v;
@@ -223,7 +224,7 @@
T &expected,
T desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
fence_before(success_order);
int current, success;
@@ -249,9 +250,9 @@
return desired;
}
- bool is_lock_free(void) const volatile {return true;}
+ bool is_lock_free(void) const volatile BOOST_NOEXCEPT {return true;}
protected:
- inline T fetch_add_var(T c, memory_order order) volatile
+ inline T fetch_add_var(T c, memory_order order) volatile BOOST_NOEXCEPT
{
fence_before(order);
T original, modified;
@@ -272,7 +273,7 @@
fence_after(order);
return original;
}
- inline T fetch_inc(memory_order order) volatile
+ inline T fetch_inc(memory_order order) volatile BOOST_NOEXCEPT
{
fence_before(order);
T original, modified;
@@ -293,7 +294,7 @@
fence_after(order);
return original;
}
- inline T fetch_dec(memory_order order) volatile
+ inline T fetch_dec(memory_order order) volatile BOOST_NOEXCEPT
{
fence_before(order);
T original, modified;
@@ -322,7 +323,7 @@
class platform_atomic_integral<T, 4> : public build_atomic_from_typical<build_exchange<atomic_alpha_32<T> > > {
public:
typedef build_atomic_from_typical<build_exchange<atomic_alpha_32<T> > > super;
- explicit platform_atomic_integral(T v) : super(v) {}
+ BOOST_CONSTEXPR platform_atomic_integral(T v) BOOST_NOEXCEPT: super(v) {}
platform_atomic_integral(void) {}
};
@@ -330,7 +331,7 @@
class platform_atomic_integral<T, 8> : public build_atomic_from_typical<build_exchange<atomic_alpha_64<T> > > {
public:
typedef build_atomic_from_typical<build_exchange<atomic_alpha_64<T> > > super;
- explicit platform_atomic_integral(T v) : super(v) {}
+ BOOST_CONSTEXPR platform_atomic_integral(T v) BOOST_NOEXCEPT: super(v) {}
platform_atomic_integral(void) {}
};
@@ -338,8 +339,7 @@
class platform_atomic_integral<T, 1>: public build_atomic_from_larger_type<atomic_alpha_32<uint32_t>, T> {
public:
typedef build_atomic_from_larger_type<atomic_alpha_32<uint32_t>, T> super;
-
- explicit platform_atomic_integral(T v) : super(v) {}
+ BOOST_CONSTEXPR platform_atomic_integral(T v) BOOST_NOEXCEPT: super(v) {}
platform_atomic_integral(void) {}
};
@@ -347,8 +347,7 @@
class platform_atomic_integral<T, 2>: public build_atomic_from_larger_type<atomic_alpha_32<uint32_t>, T> {
public:
typedef build_atomic_from_larger_type<atomic_alpha_32<uint32_t>, T> super;
-
- explicit platform_atomic_integral(T v) : super(v) {}
+ BOOST_CONSTEXPR platform_atomic_integral(T v) BOOST_NOEXCEPT: super(v) {}
platform_atomic_integral(void) {}
};
Modified: trunk/boost/atomic/detail/gcc-armv6plus.hpp
==============================================================================
--- trunk/boost/atomic/detail/gcc-armv6plus.hpp (original)
+++ trunk/boost/atomic/detail/gcc-armv6plus.hpp 2013-02-14 07:32:41 EST (Thu, 14 Feb 2013)
@@ -7,6 +7,7 @@
//
// Copyright (c) 2009 Helge Bahmann
// Copyright (c) 2009 Phil Endecott
+// Copyright (c) 2013 Tim Blechmann
// ARM Code by Phil Endecott, based on other architectures.
#include <cstddef>
@@ -197,10 +198,10 @@
atomic_flag & operator=(const atomic_flag &) /* = delete */ ;
uint32_t v_;
public:
- atomic_flag(void) : v_(false) {}
+ atomic_flag(void) BOOST_NOEXCEPT: v_(false) {}
void
- clear(memory_order order = memory_order_seq_cst) volatile
+ clear(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
atomics::detail::platform_fence_before_store(order);
const_cast<volatile uint32_t &>(v_) = 0;
@@ -208,7 +209,7 @@
}
bool
- test_and_set(memory_order order = memory_order_seq_cst) volatile
+ test_and_set(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
atomics::detail::platform_fence_before(order);
uint32_t expected = v_;
Modified: trunk/boost/atomic/detail/gcc-cas.hpp
==============================================================================
--- trunk/boost/atomic/detail/gcc-cas.hpp (original)
+++ trunk/boost/atomic/detail/gcc-cas.hpp 2013-02-14 07:32:41 EST (Thu, 14 Feb 2013)
@@ -1,4 +1,5 @@
// Copyright (c) 2011 Helge Bahmann
+// Copyright (c) 2013 Tim Blechmann
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
@@ -107,10 +108,10 @@
atomic_flag & operator=(const atomic_flag &) /* = delete */ ;
uint32_t v_;
public:
- atomic_flag(void) : v_(false) {}
+ atomic_flag(void) BOOST_NOEXCEPT: v_(false) {}
void
- clear(memory_order order = memory_order_seq_cst) volatile
+ clear(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
atomics::detail::platform_fence_before_store(order);
const_cast<volatile uint32_t &>(v_) = 0;
@@ -118,7 +119,7 @@
}
bool
- test_and_set(memory_order order = memory_order_seq_cst) volatile
+ test_and_set(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
atomics::detail::platform_fence_before(order);
uint32_t expected = v_;
Modified: trunk/boost/atomic/detail/gcc-ppc.hpp
==============================================================================
--- trunk/boost/atomic/detail/gcc-ppc.hpp (original)
+++ trunk/boost/atomic/detail/gcc-ppc.hpp 2013-02-14 07:32:41 EST (Thu, 14 Feb 2013)
@@ -2,6 +2,7 @@
#define BOOST_ATOMIC_DETAIL_GCC_PPC_HPP
// Copyright (c) 2009 Helge Bahmann
+// Copyright (c) 2013 Tim Blechmann
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
@@ -110,10 +111,10 @@
atomic_flag & operator=(const atomic_flag &) /* = delete */ ;
uint32_t v_;
public:
- atomic_flag(void) : v_(false) {}
+ atomic_flag(void) BOOST_NOEXCEPT: v_(false) {}
void
- clear(memory_order order = memory_order_seq_cst) volatile
+ clear(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
atomics::detail::ppc_fence_before(order);
const_cast<volatile uint32_t &>(v_) = 0;
@@ -121,7 +122,7 @@
}
bool
- test_and_set(memory_order order = memory_order_seq_cst) volatile
+ test_and_set(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
uint32_t original;
atomics::detail::ppc_fence_before(order);
@@ -201,11 +202,11 @@
typedef int32_t storage_type;
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
ppc_fence_before(order);
__asm__ (
@@ -217,7 +218,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v;
__asm__ __volatile__ (
@@ -233,7 +234,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original;
ppc_fence_before(order);
@@ -255,7 +256,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -284,7 +285,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -310,7 +311,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -329,7 +330,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -348,7 +349,7 @@
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -366,7 +367,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -384,7 +385,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -402,7 +403,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -421,11 +422,11 @@
typedef uint32_t storage_type;
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
ppc_fence_before(order);
__asm__ (
@@ -437,7 +438,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v;
__asm__ __volatile__ (
@@ -453,7 +454,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original;
ppc_fence_before(order);
@@ -475,7 +476,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -505,7 +506,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -531,7 +532,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -550,7 +551,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -569,7 +570,7 @@
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -587,7 +588,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -605,7 +606,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -623,7 +624,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -642,11 +643,11 @@
typedef int32_t storage_type;
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
ppc_fence_before(order);
__asm__ (
@@ -658,7 +659,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v;
__asm__ __volatile__ (
@@ -674,7 +675,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original;
ppc_fence_before(order);
@@ -696,7 +697,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -726,7 +727,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -752,7 +753,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -771,7 +772,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -790,7 +791,7 @@
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -808,7 +809,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -826,7 +827,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -844,7 +845,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -863,11 +864,11 @@
typedef uint32_t storage_type;
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
ppc_fence_before(order);
__asm__ (
@@ -879,7 +880,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v;
__asm__ __volatile__ (
@@ -895,7 +896,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original;
ppc_fence_before(order);
@@ -917,7 +918,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -947,7 +948,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -973,7 +974,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -992,7 +993,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -1011,7 +1012,7 @@
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -1029,7 +1030,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -1047,7 +1048,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -1065,7 +1066,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1083,11 +1084,11 @@
typedef T value_type;
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
ppc_fence_before(order);
const_cast<volatile value_type &>(v_) = v;
@@ -1095,7 +1096,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
__asm__ __volatile__ (
@@ -1111,7 +1112,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original;
ppc_fence_before(order);
@@ -1133,7 +1134,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -1163,7 +1164,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -1189,7 +1190,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -1207,7 +1208,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -1225,7 +1226,7 @@
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -1243,7 +1244,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -1261,7 +1262,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -1279,7 +1280,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1299,11 +1300,11 @@
typedef T value_type;
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
ppc_fence_before(order);
const_cast<volatile value_type &>(v_) = v;
@@ -1311,7 +1312,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
__asm__ __volatile__ (
@@ -1327,7 +1328,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original;
ppc_fence_before(order);
@@ -1349,7 +1350,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -1379,7 +1380,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -1405,7 +1406,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -1423,7 +1424,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -1441,7 +1442,7 @@
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -1459,7 +1460,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -1477,7 +1478,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original, tmp;
ppc_fence_before(order);
@@ -1495,7 +1496,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1518,11 +1519,11 @@
typedef base_atomic this_type;
typedef void * value_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
ppc_fence_before(order);
__asm__ (
@@ -1534,7 +1535,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v;
__asm__ (
@@ -1551,7 +1552,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original;
ppc_fence_before(order);
@@ -1573,7 +1574,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -1603,7 +1604,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -1629,7 +1630,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1647,11 +1648,11 @@
typedef T * value_type;
typedef ptrdiff_t difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
ppc_fence_before(order);
__asm__ (
@@ -1663,7 +1664,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v;
__asm__ (
@@ -1680,7 +1681,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original;
ppc_fence_before(order);
@@ -1702,7 +1703,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -1732,7 +1733,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -1758,7 +1759,7 @@
}
value_type
- fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
v = v * sizeof(*v_);
value_type original, tmp;
@@ -1777,7 +1778,7 @@
}
value_type
- fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
v = v * sizeof(*v_);
value_type original, tmp;
@@ -1796,7 +1797,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1815,11 +1816,11 @@
typedef base_atomic this_type;
typedef void * value_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
ppc_fence_before(order);
__asm__ (
@@ -1831,7 +1832,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v;
__asm__ (
@@ -1848,7 +1849,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original;
ppc_fence_before(order);
@@ -1870,7 +1871,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -1900,7 +1901,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -1926,7 +1927,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1944,11 +1945,11 @@
typedef T * value_type;
typedef ptrdiff_t difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
ppc_fence_before(order);
__asm__ (
@@ -1960,7 +1961,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v;
__asm__ (
@@ -1977,7 +1978,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original;
ppc_fence_before(order);
@@ -1999,7 +2000,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -2029,7 +2030,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
int success;
ppc_fence_before(success_order);
@@ -2055,7 +2056,7 @@
}
value_type
- fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
v = v * sizeof(*v_);
value_type original, tmp;
@@ -2074,7 +2075,7 @@
}
value_type
- fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
v = v * sizeof(*v_);
value_type original, tmp;
@@ -2093,7 +2094,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -2115,14 +2116,13 @@
typedef T value_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type const& v)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type const& v) BOOST_NOEXCEPT:
+ v_(*reinterpret_cast<storage_type*>(&v))
+ {}
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -2136,7 +2136,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
storage_type tmp;
__asm__ __volatile__ (
@@ -2156,7 +2156,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0, original;
memcpy(&tmp, &v, sizeof(value_type));
@@ -2181,7 +2181,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -2216,7 +2216,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -2247,7 +2247,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -2265,14 +2265,14 @@
typedef T value_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type const& v)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type const& v) BOOST_NOEXCEPT:
+ v_(*reinterpret_cast<storage_type*>(&v))
+ {}
+
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -2286,7 +2286,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
storage_type tmp;
__asm__ __volatile__ (
@@ -2306,7 +2306,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0, original;
memcpy(&tmp, &v, sizeof(value_type));
@@ -2331,7 +2331,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -2366,7 +2366,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -2397,7 +2397,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -2415,14 +2415,14 @@
typedef T value_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type const& v) : v_(0)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type const& v) BOOST_NOEXCEPT:
+ v_(*reinterpret_cast<storage_type*>(&v))
+ {}
+
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -2436,7 +2436,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
storage_type tmp;
__asm__ __volatile__ (
@@ -2456,7 +2456,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0, original;
memcpy(&tmp, &v, sizeof(value_type));
@@ -2481,7 +2481,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -2516,7 +2516,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -2547,7 +2547,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -2567,14 +2567,14 @@
typedef T value_type;
typedef uint64_t storage_type;
public:
- explicit base_atomic(value_type const& v) : v_(0)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type const& v) BOOST_NOEXCEPT:
+ v_(*reinterpret_cast<storage_type*>(&v))
+ {}
+
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp;
memcpy(&tmp, &v, sizeof(value_type));
@@ -2588,7 +2588,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
storage_type tmp;
__asm__ __volatile__ (
@@ -2608,7 +2608,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0, original;
memcpy(&tmp, &v, sizeof(value_type));
@@ -2633,7 +2633,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s, desired_s;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -2668,7 +2668,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s, desired_s;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -2699,7 +2699,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
Modified: trunk/boost/atomic/detail/gcc-sparcv9.hpp
==============================================================================
--- trunk/boost/atomic/detail/gcc-sparcv9.hpp (original)
+++ trunk/boost/atomic/detail/gcc-sparcv9.hpp 2013-02-14 07:32:41 EST (Thu, 14 Feb 2013)
@@ -2,6 +2,7 @@
#define BOOST_ATOMIC_DETAIL_GCC_SPARC_HPP
// Copyright (c) 2010 Helge Bahmann
+// Copyright (c) 2013 Tim Blechmann
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
@@ -91,7 +92,7 @@
atomic_flag(void) : v_(false) {}
void
- clear(memory_order order = memory_order_seq_cst) volatile
+ clear(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
atomics::detail::platform_fence_before(order);
const_cast<volatile uint32_t &>(v_) = 0;
@@ -99,7 +100,7 @@
}
bool
- test_and_set(memory_order order = memory_order_seq_cst) volatile
+ test_and_set(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT BOOST_NOEXCEPT
{
atomics::detail::platform_fence_before(order);
uint32_t tmp = 1;
@@ -179,11 +180,11 @@
typedef T difference_type;
typedef int32_t storage_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
const_cast<volatile storage_type &>(v_) = v;
@@ -191,7 +192,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst)const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -199,7 +200,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp + v, order, memory_order_relaxed));
@@ -207,7 +208,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp - v, order, memory_order_relaxed));
@@ -215,7 +216,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, v, order, memory_order_relaxed));
@@ -227,7 +228,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
storage_type desired_s = desired;
@@ -252,13 +253,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp & v, order, memory_order_relaxed));
@@ -266,7 +267,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp | v, order, memory_order_relaxed));
@@ -274,7 +275,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp ^ v, order, memory_order_relaxed));
@@ -282,7 +283,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -301,11 +302,11 @@
typedef T difference_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
const_cast<volatile storage_type &>(v_) = v;
@@ -313,7 +314,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst)const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -321,7 +322,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp + v, order, memory_order_relaxed));
@@ -329,7 +330,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp - v, order, memory_order_relaxed));
@@ -337,7 +338,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, v, order, memory_order_relaxed));
@@ -349,7 +350,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
storage_type desired_s = desired;
@@ -374,13 +375,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp & v, order, memory_order_relaxed));
@@ -388,7 +389,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp | v, order, memory_order_relaxed));
@@ -396,7 +397,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp ^ v, order, memory_order_relaxed));
@@ -404,7 +405,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -423,11 +424,11 @@
typedef T difference_type;
typedef int32_t storage_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
const_cast<volatile storage_type &>(v_) = v;
@@ -435,7 +436,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst)const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -443,7 +444,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp + v, order, memory_order_relaxed));
@@ -451,7 +452,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp - v, order, memory_order_relaxed));
@@ -459,7 +460,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, v, order, memory_order_relaxed));
@@ -471,7 +472,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
storage_type desired_s = desired;
@@ -496,13 +497,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp & v, order, memory_order_relaxed));
@@ -510,7 +511,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp | v, order, memory_order_relaxed));
@@ -518,7 +519,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp ^ v, order, memory_order_relaxed));
@@ -526,7 +527,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -545,11 +546,11 @@
typedef T difference_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
const_cast<volatile storage_type &>(v_) = v;
@@ -557,7 +558,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst)const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -565,7 +566,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp + v, order, memory_order_relaxed));
@@ -573,7 +574,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp - v, order, memory_order_relaxed));
@@ -581,7 +582,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, v, order, memory_order_relaxed));
@@ -593,7 +594,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
storage_type desired_s = desired;
@@ -618,13 +619,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp & v, order, memory_order_relaxed));
@@ -632,7 +633,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp | v, order, memory_order_relaxed));
@@ -640,7 +641,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp ^ v, order, memory_order_relaxed));
@@ -648,7 +649,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -666,11 +667,11 @@
typedef T value_type;
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
const_cast<volatile value_type &>(v_) = v;
@@ -678,7 +679,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst)const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
@@ -686,7 +687,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp + v, order, memory_order_relaxed));
@@ -694,7 +695,7 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp - v, order, memory_order_relaxed));
@@ -702,7 +703,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, v, order, memory_order_relaxed));
@@ -714,7 +715,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
__asm__ (
@@ -737,13 +738,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp & v, order, memory_order_relaxed));
@@ -751,7 +752,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp | v, order, memory_order_relaxed));
@@ -759,7 +760,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp ^ v, order, memory_order_relaxed));
@@ -767,7 +768,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -786,18 +787,18 @@
typedef base_atomic this_type;
typedef void * value_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
const_cast<volatile value_type &>(v_) = v;
platform_fence_after_store(order);
}
- value_type load(memory_order order = memory_order_seq_cst) const volatile
+ value_type load(memory_order order = memory_order_seq_cst)const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
@@ -805,7 +806,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, v, order, memory_order_relaxed));
@@ -817,7 +818,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
__asm__ (
@@ -838,13 +839,13 @@
bool compare_exchange_weak(value_type & expected, value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -862,11 +863,11 @@
typedef T * value_type;
typedef ptrdiff_t difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) : v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
const_cast<volatile value_type &>(v_) = v;
@@ -874,7 +875,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst)const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
@@ -882,7 +883,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, v, order, memory_order_relaxed));
@@ -894,7 +895,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
__asm__ (
@@ -917,13 +918,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp + v, order, memory_order_relaxed));
@@ -931,7 +932,7 @@
}
value_type
- fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, tmp - v, order, memory_order_relaxed));
@@ -939,7 +940,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -959,14 +960,14 @@
typedef T value_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type const& v) : v_(0)
+ BOOST_CONSTEXPR base_atomic(value_type const& v) : v_(0)
{
memcpy(&v_, &v, sizeof(value_type));
}
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -976,7 +977,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst)const volatile BOOST_NOEXCEPT
{
storage_type tmp = const_cast<volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -986,7 +987,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, v, order, memory_order_relaxed));
@@ -998,7 +999,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -1024,13 +1025,13 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1048,14 +1049,14 @@
typedef T value_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type const& v) : v_(0)
+ BOOST_CONSTEXPR base_atomic(value_type const& v) : v_(0)
{
memcpy(&v_, &v, sizeof(value_type));
}
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -1065,7 +1066,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst)const volatile BOOST_NOEXCEPT
{
storage_type tmp = const_cast<volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -1075,7 +1076,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, v, order, memory_order_relaxed));
@@ -1087,7 +1088,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -1113,13 +1114,13 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1137,14 +1138,14 @@
typedef T value_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type const& v) : v_(0)
+ BOOST_CONSTEXPR base_atomic(value_type const& v) : v_(0)
{
memcpy(&v_, &v, sizeof(value_type));
}
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -1154,7 +1155,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst)const volatile BOOST_NOEXCEPT
{
storage_type tmp = const_cast<volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -1164,7 +1165,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
do {} while(!compare_exchange_weak(tmp, v, order, memory_order_relaxed));
@@ -1176,7 +1177,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -1202,13 +1203,13 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
Modified: trunk/boost/atomic/detail/gcc-x86.hpp
==============================================================================
--- trunk/boost/atomic/detail/gcc-x86.hpp (original)
+++ trunk/boost/atomic/detail/gcc-x86.hpp 2013-02-14 07:32:41 EST (Thu, 14 Feb 2013)
@@ -154,7 +154,7 @@
atomic_flag(void) : v_(0) {}
bool
- test_and_set(memory_order order = memory_order_seq_cst) volatile
+ test_and_set(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
uint32_t v = 1;
atomics::detail::platform_fence_before(order);
@@ -167,7 +167,7 @@
}
void
- clear(memory_order order = memory_order_seq_cst) volatile
+ clear(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order == memory_order_seq_cst) {
uint32_t v = 0;
@@ -251,11 +251,11 @@
typedef T value_type;
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
platform_fence_before(order);
@@ -266,7 +266,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
@@ -274,7 +274,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
__asm__ (
@@ -286,13 +286,13 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
return fetch_add(-v, order);
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
__asm__ (
@@ -308,7 +308,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
value_type previous = expected;
platform_fence_before(success_order);
@@ -331,13 +331,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
for(; !compare_exchange_weak(tmp, tmp & v, order, memory_order_relaxed);)
@@ -348,7 +348,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
for (; !compare_exchange_weak(tmp, tmp | v, order, memory_order_relaxed);)
@@ -359,7 +359,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
for (; !compare_exchange_weak(tmp, tmp ^ v, order, memory_order_relaxed);)
@@ -370,7 +370,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -388,11 +388,11 @@
typedef T value_type;
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
platform_fence_before(order);
@@ -403,7 +403,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
@@ -411,7 +411,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
__asm__ (
@@ -423,13 +423,13 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
return fetch_add(-v, order);
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
__asm__ (
@@ -445,7 +445,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
value_type previous = expected;
platform_fence_before(success_order);
@@ -468,13 +468,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
for (; !compare_exchange_weak(tmp, tmp & v, order, memory_order_relaxed);)
@@ -485,7 +485,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
for (; !compare_exchange_weak(tmp, tmp | v, order, memory_order_relaxed);)
@@ -496,7 +496,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
for (; !compare_exchange_weak(tmp, tmp ^ v, order, memory_order_relaxed);)
@@ -507,7 +507,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -525,11 +525,11 @@
typedef T value_type;
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
platform_fence_before(order);
@@ -540,7 +540,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
@@ -548,7 +548,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
__asm__ (
@@ -560,13 +560,13 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
return fetch_add(-v, order);
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
__asm__ (
@@ -582,7 +582,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
value_type previous = expected;
platform_fence_before(success_order);
@@ -605,13 +605,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
for (; !compare_exchange_weak(tmp, tmp & v, order, memory_order_relaxed);)
@@ -622,7 +622,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
for (; !compare_exchange_weak(tmp, tmp | v, order, memory_order_relaxed);)
@@ -633,7 +633,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
for (; !compare_exchange_weak(tmp, tmp ^ v, order, memory_order_relaxed);)
@@ -644,7 +644,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -663,11 +663,11 @@
typedef T value_type;
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
platform_fence_before(order);
@@ -678,7 +678,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
@@ -686,7 +686,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
__asm__ (
@@ -698,13 +698,13 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
return fetch_add(-v, order);
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
__asm__ (
@@ -720,7 +720,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
value_type previous = expected;
platform_fence_before(success_order);
@@ -743,13 +743,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
for (; !compare_exchange_weak(tmp, tmp & v, order, memory_order_relaxed);)
@@ -760,7 +760,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
for (; !compare_exchange_weak(tmp, tmp | v, order, memory_order_relaxed);)
@@ -771,7 +771,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type tmp = load(memory_order_relaxed);
for (; !compare_exchange_weak(tmp, tmp ^ v, order, memory_order_relaxed);)
@@ -782,7 +782,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -805,11 +805,11 @@
typedef base_atomic this_type;
typedef void * value_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
platform_fence_before(order);
@@ -819,14 +819,14 @@
}
}
- value_type load(memory_order order = memory_order_seq_cst) const volatile
+ value_type load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
return v;
}
- value_type exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ value_type exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
__asm__ (
@@ -839,7 +839,7 @@
bool compare_exchange_strong(value_type & expected, value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
value_type previous = expected;
platform_fence_before(success_order);
@@ -859,13 +859,13 @@
bool compare_exchange_weak(value_type & expected, value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -883,11 +883,11 @@
typedef T * value_type;
typedef ptrdiff_t difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
platform_fence_before(order);
@@ -898,7 +898,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
@@ -906,7 +906,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
__asm__ (
@@ -922,7 +922,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
value_type previous = expected;
platform_fence_before(success_order);
@@ -945,13 +945,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
v = v * sizeof(*v_);
platform_fence_before(order);
@@ -964,13 +964,13 @@
}
value_type
- fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
return fetch_add(-v, order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -989,11 +989,11 @@
typedef base_atomic this_type;
typedef void * value_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
platform_fence_before(order);
@@ -1003,14 +1003,14 @@
}
}
- value_type load(memory_order order = memory_order_seq_cst) const volatile
+ value_type load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
return v;
}
- value_type exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ value_type exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
__asm__ (
@@ -1023,7 +1023,7 @@
bool compare_exchange_strong(value_type & expected, value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
value_type previous = expected;
platform_fence_before(success_order);
@@ -1043,13 +1043,13 @@
bool compare_exchange_weak(value_type & expected, value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1067,11 +1067,11 @@
typedef T * value_type;
typedef ptrdiff_t difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
platform_fence_before(order);
@@ -1082,7 +1082,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
@@ -1090,7 +1090,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
__asm__ (
@@ -1106,7 +1106,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
value_type previous = expected;
platform_fence_before(success_order);
@@ -1129,13 +1129,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
v = v * sizeof(*v_);
platform_fence_before(order);
@@ -1148,13 +1148,13 @@
}
value_type
- fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
return fetch_add(-v, order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1174,14 +1174,13 @@
typedef T value_type;
typedef uint8_t storage_type;
public:
- explicit base_atomic(value_type const& v)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT:
+ v_(*reinterpret_cast<uint8_t*>(&v))
+ {}
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
storage_type tmp;
@@ -1194,7 +1193,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
storage_type tmp = const_cast<volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -1204,7 +1203,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp;
memcpy(&tmp, &v, sizeof(value_type));
@@ -1224,7 +1223,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s, desired_s;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -1250,13 +1249,13 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1274,14 +1273,13 @@
typedef T value_type;
typedef uint16_t storage_type;
public:
- explicit base_atomic(value_type const& v)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT:
+ v_(*reinterpret_cast<uint16_t*>(&v))
+ {}
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
storage_type tmp;
@@ -1294,7 +1292,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
storage_type tmp = const_cast<volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -1304,7 +1302,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp;
memcpy(&tmp, &v, sizeof(value_type));
@@ -1324,7 +1322,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s, desired_s;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -1350,13 +1348,13 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1374,14 +1372,13 @@
typedef T value_type;
typedef uint32_t storage_type;
public:
- explicit base_atomic(value_type const& v) : v_(0)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT
+ : v_(*reinterpret_cast<uint32_t*>(&v))
+ {}
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
storage_type tmp = 0;
@@ -1394,7 +1391,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
storage_type tmp = const_cast<volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -1404,7 +1401,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -1424,7 +1421,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -1450,13 +1447,13 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1475,14 +1472,13 @@
typedef T value_type;
typedef uint64_t storage_type;
public:
- explicit base_atomic(value_type const& v) : v_(0)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT:
+ v_(*reinterpret_cast<storage_type*>(&v))
+ {}
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
storage_type tmp = 0;
@@ -1495,7 +1491,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
storage_type tmp = const_cast<volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -1505,7 +1501,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -1525,7 +1521,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -1551,13 +1547,13 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1625,7 +1621,7 @@
template<typename T>
inline T
-platform_load64(const volatile T * ptr)
+platform_load64(const volatile BOOST_NOEXCEPT T * ptr)
{
T expected = *ptr;
for (; !platform_cmpxchg64_strong(expected, expected, const_cast<volatile T*>(ptr));)
Modified: trunk/boost/atomic/detail/linux-arm.hpp
==============================================================================
--- trunk/boost/atomic/detail/linux-arm.hpp (original)
+++ trunk/boost/atomic/detail/linux-arm.hpp 2013-02-14 07:32:41 EST (Thu, 14 Feb 2013)
@@ -7,6 +7,7 @@
//
// Copyright (c) 2009, 2011 Helge Bahmann
// Copyright (c) 2009 Phil Endecott
+// Copyright (c) 2013 Tim Blechmann
// Linux-specific code by Phil Endecott
// Different ARM processors have different atomic instructions. In particular,
@@ -138,10 +139,10 @@
atomic_flag & operator=(const atomic_flag &) /* = delete */ ;
uint32_t v_;
public:
- atomic_flag(void) : v_(false) {}
+ atomic_flag(void) BOOST_NOEXCEPT: v_(false) {}
void
- clear(memory_order order = memory_order_seq_cst) volatile
+ clear(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
atomics::detail::platform_fence_before_store(order);
const_cast<volatile uint32_t &>(v_) = 0;
@@ -149,7 +150,7 @@
}
bool
- test_and_set(memory_order order = memory_order_seq_cst) volatile
+ test_and_set(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
atomics::detail::platform_fence_before(order);
uint32_t expected = v_;
Modified: trunk/boost/atomic/detail/windows.hpp
==============================================================================
--- trunk/boost/atomic/detail/windows.hpp (original)
+++ trunk/boost/atomic/detail/windows.hpp 2013-02-14 07:32:41 EST (Thu, 14 Feb 2013)
@@ -3,6 +3,7 @@
// Copyright (c) 2009 Helge Bahmann
// Copyright (c) 2012 Andrey Semashev
+// Copyright (c) 2013 Tim Blechmann
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
@@ -133,10 +134,10 @@
atomic_flag & operator=(const atomic_flag &) /* = delete */ ;
uint32_t v_;
public:
- atomic_flag(void) : v_(0) {}
+ atomic_flag(void) BOOST_NOEXCEPT : v_(0) {}
bool
- test_and_set(memory_order order = memory_order_seq_cst) volatile
+ test_and_set(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
atomics::detail::platform_fence_before(order);
const uint32_t old = (uint32_t)BOOST_ATOMIC_INTERLOCKED_EXCHANGE(&v_, 1);
@@ -145,7 +146,7 @@
}
void
- clear(memory_order order = memory_order_seq_cst) volatile
+ clear(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
atomics::detail::platform_fence_before_store(order);
BOOST_ATOMIC_INTERLOCKED_EXCHANGE(&v_, 0);
@@ -195,11 +196,11 @@
#endif
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
platform_fence_before(order);
@@ -210,7 +211,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = static_cast< value_type >(v_);
platform_fence_after_load(order);
@@ -218,7 +219,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
#ifdef BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD8
@@ -231,14 +232,14 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
typedef typename make_signed< value_type >::type signed_value_type;
return fetch_add(static_cast< value_type >(-static_cast< signed_value_type >(v)), order);
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
#ifdef BOOST_ATOMIC_INTERLOCKED_EXCHANGE8
@@ -255,7 +256,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
value_type previous = expected;
platform_fence_before(success_order);
@@ -278,13 +279,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
#ifdef BOOST_ATOMIC_INTERLOCKED_AND8
platform_fence_before(order);
@@ -307,7 +308,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
#ifdef BOOST_ATOMIC_INTERLOCKED_OR8
platform_fence_before(order);
@@ -330,7 +331,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
#ifdef BOOST_ATOMIC_INTERLOCKED_XOR8
platform_fence_before(order);
@@ -353,7 +354,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -381,11 +382,11 @@
#endif
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
platform_fence_before(order);
@@ -396,7 +397,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = static_cast< value_type >(v_);
platform_fence_after_load(order);
@@ -404,7 +405,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
#ifdef BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD16
@@ -417,14 +418,14 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
typedef typename make_signed< value_type >::type signed_value_type;
return fetch_add(static_cast< value_type >(-static_cast< signed_value_type >(v)), order);
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
#ifdef BOOST_ATOMIC_INTERLOCKED_EXCHANGE16
@@ -441,7 +442,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
value_type previous = expected;
platform_fence_before(success_order);
@@ -464,13 +465,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
#ifdef BOOST_ATOMIC_INTERLOCKED_AND16
platform_fence_before(order);
@@ -493,7 +494,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
#ifdef BOOST_ATOMIC_INTERLOCKED_OR16
platform_fence_before(order);
@@ -516,7 +517,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
#ifdef BOOST_ATOMIC_INTERLOCKED_XOR16
platform_fence_before(order);
@@ -539,7 +540,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -559,11 +560,11 @@
typedef value_type storage_type;
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
platform_fence_before(order);
@@ -574,7 +575,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = static_cast< value_type >(v_);
platform_fence_after_load(order);
@@ -582,7 +583,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
v = static_cast< value_type >(BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD(&v_, v));
@@ -591,14 +592,14 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
typedef typename make_signed< value_type >::type signed_value_type;
return fetch_add(static_cast< value_type >(-static_cast< signed_value_type >(v)), order);
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
v = static_cast< value_type >(BOOST_ATOMIC_INTERLOCKED_EXCHANGE(&v_, v));
@@ -611,7 +612,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
value_type previous = expected;
platform_fence_before(success_order);
@@ -630,13 +631,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
#if defined(BOOST_ATOMIC_INTERLOCKED_AND)
platform_fence_before(order);
@@ -654,7 +655,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
#if defined(BOOST_ATOMIC_INTERLOCKED_OR)
platform_fence_before(order);
@@ -672,7 +673,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
#if defined(BOOST_ATOMIC_INTERLOCKED_XOR)
platform_fence_before(order);
@@ -690,7 +691,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void)const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -712,11 +713,11 @@
typedef value_type storage_type;
typedef T difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
platform_fence_before(order);
@@ -727,7 +728,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst)const volatile BOOST_NOEXCEPT
{
value_type v = static_cast< value_type >(v_);
platform_fence_after_load(order);
@@ -735,7 +736,7 @@
}
value_type
- fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
v = static_cast< value_type >(BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(&v_, v));
@@ -744,14 +745,14 @@
}
value_type
- fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
typedef typename make_signed< value_type >::type signed_value_type;
return fetch_add(static_cast< value_type >(-static_cast< signed_value_type >(v)), order);
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
v = static_cast< value_type >(BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(&v_, v));
@@ -764,7 +765,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
value_type previous = expected;
platform_fence_before(success_order);
@@ -783,13 +784,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
#if defined(BOOST_ATOMIC_INTERLOCKED_AND64)
platform_fence_before(order);
@@ -807,7 +808,7 @@
}
value_type
- fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
#if defined(BOOST_ATOMIC_INTERLOCKED_OR64)
platform_fence_before(order);
@@ -825,7 +826,7 @@
}
value_type
- fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
#if defined(BOOST_ATOMIC_INTERLOCKED_XOR64)
platform_fence_before(order);
@@ -843,7 +844,7 @@
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void)const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -866,11 +867,11 @@
typedef base_atomic this_type;
typedef void* value_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
platform_fence_before(order);
@@ -880,14 +881,14 @@
}
}
- value_type load(memory_order order = memory_order_seq_cst) const volatile
+ value_type load(memory_order order = memory_order_seq_cst)const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
return v;
}
- value_type exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ value_type exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
v = (value_type)BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER(&v_, v);
@@ -897,7 +898,7 @@
bool compare_exchange_strong(value_type & expected, value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
value_type previous = expected;
platform_fence_before(success_order);
@@ -913,13 +914,13 @@
bool compare_exchange_weak(value_type & expected, value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void)const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -938,11 +939,11 @@
typedef T* value_type;
typedef ptrdiff_t difference_type;
public:
- explicit base_atomic(value_type v) : v_(v) {}
+ BOOST_CONSTEXPR base_atomic(atomic_type v) BOOST_NOEXCEPT: v_(v) {}
base_atomic(void) {}
void
- store(value_type v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
platform_fence_before(order);
@@ -953,7 +954,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst)const volatile BOOST_NOEXCEPT
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
@@ -961,7 +962,7 @@
}
value_type
- exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before(order);
v = (value_type)BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER(&v_, v);
@@ -974,7 +975,7 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
value_type previous = expected;
platform_fence_before(success_order);
@@ -993,13 +994,13 @@
value_type & expected,
value_type desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
- fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
v = v * sizeof(*v_);
platform_fence_before(order);
@@ -1009,13 +1010,13 @@
}
value_type
- fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile
+ fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
return fetch_add(-v, order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void)const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1039,14 +1040,13 @@
typedef uint32_t storage_type;
#endif
public:
- explicit base_atomic(value_type const& v) : v_(0)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type const& v) BOOST_NOEXCEPT:
+ v_(*reinterpret_cast<storage_type*>(&v))
+ {}
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
storage_type tmp = 0;
@@ -1059,7 +1059,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
storage_type tmp = const_cast<volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -1069,7 +1069,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -1090,7 +1090,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -1115,13 +1115,13 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1144,14 +1144,14 @@
typedef uint32_t storage_type;
#endif
public:
- explicit base_atomic(value_type const& v) : v_(0)
- {
- memcpy(&v_, &v, sizeof(value_type));
- }
+ BOOST_CONSTEXPR base_atomic(value_type const& v) BOOST_NOEXCEPT:
+ v_(*reinterpret_cast<storage_type*>(&v))
+ {}
+
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
storage_type tmp = 0;
@@ -1164,7 +1164,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst)const volatile BOOST_NOEXCEPT
{
storage_type tmp = const_cast<volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -1174,7 +1174,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -1195,7 +1195,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -1220,13 +1220,13 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void)const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1252,7 +1252,7 @@
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
storage_type tmp = 0;
@@ -1265,7 +1265,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst)const volatile BOOST_NOEXCEPT
{
storage_type tmp = const_cast<volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -1275,7 +1275,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -1292,7 +1292,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -1313,13 +1313,13 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void)const volatile BOOST_NOEXCEPT
{
return true;
}
@@ -1347,7 +1347,7 @@
base_atomic(void) {}
void
- store(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
if (order != memory_order_seq_cst) {
storage_type tmp = 0;
@@ -1360,7 +1360,7 @@
}
value_type
- load(memory_order order = memory_order_seq_cst) const volatile
+ load(memory_order order = memory_order_seq_cst)const volatile BOOST_NOEXCEPT
{
storage_type tmp = const_cast<volatile storage_type &>(v_);
platform_fence_after_load(order);
@@ -1370,7 +1370,7 @@
}
value_type
- exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile
+ exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
@@ -1387,7 +1387,7 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
@@ -1408,13 +1408,13 @@
value_type & expected,
value_type const& desired,
memory_order success_order,
- memory_order failure_order) volatile
+ memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
- is_lock_free(void) const volatile
+ is_lock_free(void)const volatile BOOST_NOEXCEPT
{
return true;
}
Modified: trunk/libs/atomic/test/api_test_helpers.hpp
==============================================================================
--- trunk/libs/atomic/test/api_test_helpers.hpp (original)
+++ trunk/libs/atomic/test/api_test_helpers.hpp 2013-02-14 07:32:41 EST (Thu, 14 Feb 2013)
@@ -100,6 +100,17 @@
}
}
+// T requires an int constructor
+template <typename T>
+void test_constexpr_ctor()
+{
+#ifndef BOOST_NO_CXX11_CONSTEXPR
+ const T value(0);
+ const boost::atomic<T> tester(value);
+ BOOST_CHECK( tester == value );
+#endif
+}
+
template<typename T, typename D>
void test_additive_operators(T value, D delta)
{
Modified: trunk/libs/atomic/test/native_api.cpp
==============================================================================
--- trunk/libs/atomic/test/native_api.cpp (original)
+++ trunk/libs/atomic/test/native_api.cpp 2013-02-14 07:32:41 EST (Thu, 14 Feb 2013)
@@ -34,6 +34,12 @@
test_integral_api<long long>();
test_integral_api<unsigned long long>();
+ test_constexpr_ctor<char>();
+ test_constexpr_ctor<short>();
+ test_constexpr_ctor<int>();
+ test_constexpr_ctor<long>();
+ test_constexpr_ctor<int*>();
+
test_pointer_api<int>();
test_enum_api();
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk