File indexing completed on 2025-01-18 09:51:42
0001 #ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_NT_HPP_INCLUDED
0002 #define BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_NT_HPP_INCLUDED
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #if defined(BOOST_SP_REPORT_IMPLEMENTATION)
0019
0020 #include <boost/config/pragma_message.hpp>
0021 BOOST_PRAGMA_MESSAGE("Using single-threaded, non-atomic atomic_count")
0022
0023 #endif
0024
0025 namespace boost
0026 {
0027
0028 namespace detail
0029 {
0030
0031 class atomic_count
0032 {
0033 public:
0034
0035 explicit atomic_count( long v ): value_( v )
0036 {
0037 }
0038
0039 long operator++()
0040 {
0041 return ++value_;
0042 }
0043
0044 long operator--()
0045 {
0046 return --value_;
0047 }
0048
0049 operator long() const
0050 {
0051 return value_;
0052 }
0053
0054 private:
0055
0056 atomic_count(atomic_count const &);
0057 atomic_count & operator=(atomic_count const &);
0058
0059 long value_;
0060 };
0061
0062 }
0063
0064 }
0065
0066 #endif