21 template<
class V,
class LkT>
inline constexpr
26 template<
class V,
class LkT>
inline constexpr
31 template<
class V,
class LkT>
inline constexpr
36 template<
class V,
class LkT>
41 static_assert(
std::is_base_of<
typename std::remove_pointer<
value_type>::type,
typename std::remove_pointer<V1>::type>::value,
"The two types must have the same base.");
44 template<
class V,
class LkT>
49 static_assert(
std::is_base_of<
typename std::remove_pointer<
value_type>::type,
typename std::remove_pointer<V1>::type>::value,
"The two types must have the same base.");
53 template<
class V,
class LkT>
inline
57 template<
class V,
class LkT>
inline void
60 const typename atomic_t::write_lock_type lock_that(a.locker,
atomic_t::lock_traits::infinite_timeout());
64 template<
class V,
class LkT>
65 template<
class V1,
class V2>
66 inline typename std::enable_if<
std::is_pointer<V2>::value,
void>::
type
70 const typename atomic_t::write_lock_type lock_that(a.locker,
atomic_t::lock_traits::infinite_timeout());
74 template<
class V,
class LkT>
inline void
77 const typename atomic_t::read_lock_type lock_that(a.locker,
atomic_t::lock_traits::infinite_timeout());
81 template<
class V,
class LkT>
82 template<
class V1,
class V2>
83 inline typename std::enable_if<
std::is_pointer<V2>::value,
void>::
type
85 static_assert(
std::is_base_of<
typename std::remove_pointer<
value_type>::type,
typename std::remove_pointer<V1>::type>::value,
"The two types must have the same base.");
87 const typename atomic_t::read_lock_type lock_that(a.locker,
atomic_t::lock_traits::infinite_timeout());
91 template<
class V,
class LkT>
inline void
102 template<
class V,
class LkT>
inline constexpr bool
107 template<
class V,
class LkT>
inline constexpr bool
109 return count==a.count;
112 template<
class V,
class LkT>
inline constexpr bool
114 return !operator==(v);
117 template<
class V,
class LkT>
inline constexpr bool
119 return !operator==(a);
122 template<
class V,
class LkT>
inline constexpr bool
124 return operator==(0);
127 template<
class V,
class LkT>
inline constexpr bool
132 template<
class V,
class LkT>
inline constexpr bool
134 return count<a.count;
137 template<
class V,
class LkT>
inline constexpr bool
142 template<
class V,
class LkT>
inline constexpr bool
147 template<
class V,
class LkT>
inline constexpr bool
149 return count>a.count;
152 template<
class V,
class LkT>
inline constexpr bool
157 template<
class V,
class LkT>
inline constexpr bool
162 template<
class V,
class LkT>
inline constexpr bool
164 return count<=a.count;
167 template<
class V,
class LkT>
inline constexpr bool
169 return count>=a.count;
172 template<
class V,
class LkT>
inline constexpr bool
215 const typename atomic_t::read_lock_type lock_that(a.locker,
atomic_t::lock_traits::infinite_timeout());
230 const typename atomic_t::read_lock_type lock_that(a.locker,
atomic_t::lock_traits::infinite_timeout());
235 template<
class V,
class LkT>
236 template<
class BinOp>
245 template<
class V,
class LkT>
253 template<
class V,
class LkT>
261 template<
class V,
class LkT>
265 if (
count==expected) {
273 template<
class V,
class LkT>
274 template<
class V1,
class V2>
275 inline typename std::enable_if<
std::is_pointer<V2>::value,
bool>::
type
277 static_assert(
std::is_base_of<
typename std::remove_pointer<
value_type>::type,
typename std::remove_pointer<V1>::type>::value,
"The two types must have the same base.");
279 if (
count==expected) {
287 template<
class V,
class LkT>
294 }
while (!compare_exchange_strong(expected, op(expected)));
298 template<
class V,
class LkT>
inline constexpr
303 template<
class V,
class LkT>
inline constexpr
308 template<
class V,
class LkT>
constexpr inline
313 template<
class V,
class LkT>
321 template<
class V,
class LkT>
330 template<
class V,
class LkT>
inline
332 assert(count.is_lock_free());
335 template<
class V,
class LkT>
inline void
338 a.count.store(lhs_orig);
341 template<
class V,
class LkT>
342 template<
class V1,
class V2>
343 inline typename std::enable_if<
std::is_pointer<V2>::value,
void>::
type
347 a.count.exchange(
dynamic_cast<
typename atomic_ctr_opt<V1, LkT>::value_type>(
count.load()));
351 template<
class V,
class LkT>
352 template<
class V1,
class V2>
353 inline typename std::enable_if<
std::is_pointer<V2>::value,
void>::
type
356 assert(count.is_lock_free() && a.count.is_lock_free());
360 template<
class V,
class LkT>
inline void
362 assert(count.is_lock_free() && a.count.is_lock_free());
366 template<
class V,
class LkT>
inline void
368 assert(count.is_lock_free());
374 assert(count.is_lock_free());
378 template<
class V,
class LkT>
constexpr inline bool
380 assert(count.is_lock_free());
384 template<
class V,
class LkT>
constexpr inline bool
386 assert(count.is_lock_free() && a.count.is_lock_free());
387 return count==a.count;
390 template<
class V,
class LkT>
constexpr inline bool
392 assert(count.is_lock_free());
393 return !operator==(v);
396 template<
class V,
class LkT>
constexpr inline bool
398 assert(count.is_lock_free() && a.count.is_lock_free());
399 return !operator==(a);
402 template<
class V,
class LkT>
constexpr inline
404 assert(count.is_lock_free());
408 template<
class V,
class LkT>
constexpr inline bool
410 assert(count.is_lock_free());
414 template<
class V,
class LkT>
constexpr inline bool
416 assert(count.is_lock_free() && a.count.is_lock_free());
417 return count<a.count;
420 template<
class V,
class LkT>
constexpr inline bool
422 assert(count.is_lock_free());
426 template<
class V,
class LkT>
constexpr inline bool
428 assert(count.is_lock_free());
432 template<
class V,
class LkT>
constexpr inline bool
434 assert(count.is_lock_free() && a.count.is_lock_free());
435 return count>a.count;
438 template<
class V,
class LkT>
constexpr inline bool
440 assert(count.is_lock_free());
444 template<
class V,
class LkT>
constexpr inline bool
446 assert(count.is_lock_free());
450 template<
class V,
class LkT>
constexpr inline bool
452 assert(count.is_lock_free() && a.count.is_lock_free());
453 return count<=a.count;
456 template<
class V,
class LkT>
constexpr inline bool
458 assert(count.is_lock_free() && a.count.is_lock_free());
459 return count>=a.count;
462 template<
class V,
class LkT>
constexpr inline bool
464 assert(count.is_lock_free());
470 assert(count.is_lock_free());
476 assert(count.is_lock_free());
482 assert(count.is_lock_free());
488 assert(count.is_lock_free());
494 assert(count.is_lock_free());
500 assert(count.is_lock_free() && a.count.is_lock_free());
501 return *
this+=a.count;
506 assert(count.is_lock_free());
512 assert(count.is_lock_free() && a.count.is_lock_free());
513 return *
this-=a.count;
516 template<
class V,
class LkT>
519 assert(count.is_lock_free());
520 return count.compare_exchange_strong(expected, desired);
523 template<
class V,
class LkT>
524 template<
class V1,
class V2>
525 inline typename std::enable_if<
std::is_pointer<V2>::value,
bool>::
type
527 static_assert(
std::is_base_of<
typename std::remove_pointer<
value_type>::type,
typename std::remove_pointer<V1>::type>::value,
"The two types must have the same base.");
528 return count.compare_exchange_strong(expected, desired);
531 template<
class V,
class LkT>
532 template<
class BinOp>
536 assert(count.is_lock_free());
540 desired=op.operator()(expected, a);
541 }
while (!compare_exchange_strong(expected, desired));
545 template<
class V,
class LkT>
550 assert(count.is_lock_free());
554 template<
class V,
class LkT>
559 assert(count.is_lock_free());
563 template<
class V,
class LkT>
570 }
while (!compare_exchange_strong(expected.get(), op(expected).get()));