equal
deleted
inserted
replaced
76 |
76 |
77 template<size_t byte_size> |
77 template<size_t byte_size> |
78 struct Atomic::PlatformAdd |
78 struct Atomic::PlatformAdd |
79 : Atomic::AddAndFetch<Atomic::PlatformAdd<byte_size> > |
79 : Atomic::AddAndFetch<Atomic::PlatformAdd<byte_size> > |
80 { |
80 { |
81 template<typename I, typename D> |
81 template<typename D, typename I> |
82 D add_and_fetch(I add_value, D volatile* dest, atomic_memory_order order) const; |
82 D add_and_fetch(D volatile* dest, I add_value, atomic_memory_order order) const; |
83 }; |
83 }; |
84 |
84 |
85 template<> |
85 template<> |
86 template<typename I, typename D> |
86 template<typename D, typename I> |
87 inline D Atomic::PlatformAdd<4>::add_and_fetch(I inc, D volatile* dest, |
87 inline D Atomic::PlatformAdd<4>::add_and_fetch(D volatile* dest, I inc, |
88 atomic_memory_order order) const { |
88 atomic_memory_order order) const { |
89 STATIC_ASSERT(4 == sizeof(I)); |
89 STATIC_ASSERT(4 == sizeof(I)); |
90 STATIC_ASSERT(4 == sizeof(D)); |
90 STATIC_ASSERT(4 == sizeof(D)); |
91 |
91 |
92 D old, upd; |
92 D old, upd; |
135 return upd; |
135 return upd; |
136 } |
136 } |
137 |
137 |
138 |
138 |
139 template<> |
139 template<> |
140 template<typename I, typename D> |
140 template<typename D, typename I> |
141 inline D Atomic::PlatformAdd<8>::add_and_fetch(I inc, D volatile* dest, |
141 inline D Atomic::PlatformAdd<8>::add_and_fetch(D volatile* dest, I inc, |
142 atomic_memory_order order) const { |
142 atomic_memory_order order) const { |
143 STATIC_ASSERT(8 == sizeof(I)); |
143 STATIC_ASSERT(8 == sizeof(I)); |
144 STATIC_ASSERT(8 == sizeof(D)); |
144 STATIC_ASSERT(8 == sizeof(D)); |
145 |
145 |
146 D old, upd; |
146 D old, upd; |