equal
deleted
inserted
replaced
94 |
94 |
95 template<size_t byte_size> |
95 template<size_t byte_size> |
96 struct Atomic::PlatformAdd |
96 struct Atomic::PlatformAdd |
97 : Atomic::AddAndFetch<Atomic::PlatformAdd<byte_size> > |
97 : Atomic::AddAndFetch<Atomic::PlatformAdd<byte_size> > |
98 { |
98 { |
99 template<typename I, typename D> |
99 template<typename D, typename I> |
100 D add_and_fetch(I add_value, D volatile* dest, atomic_memory_order order) const; |
100 D add_and_fetch(D volatile* dest, I add_value, atomic_memory_order order) const; |
101 }; |
101 }; |
102 |
102 |
103 template<> |
103 template<> |
104 template<typename I, typename D> |
104 template<typename D, typename I> |
105 inline D Atomic::PlatformAdd<4>::add_and_fetch(I add_value, D volatile* dest, |
105 inline D Atomic::PlatformAdd<4>::add_and_fetch(D volatile* dest, I add_value, |
106 atomic_memory_order order) const { |
106 atomic_memory_order order) const { |
107 STATIC_ASSERT(4 == sizeof(I)); |
107 STATIC_ASSERT(4 == sizeof(I)); |
108 STATIC_ASSERT(4 == sizeof(D)); |
108 STATIC_ASSERT(4 == sizeof(D)); |
109 |
109 |
110 D result; |
110 D result; |
125 return result; |
125 return result; |
126 } |
126 } |
127 |
127 |
128 |
128 |
129 template<> |
129 template<> |
130 template<typename I, typename D> |
130 template<typename D, typename I> |
131 inline D Atomic::PlatformAdd<8>::add_and_fetch(I add_value, D volatile* dest, |
131 inline D Atomic::PlatformAdd<8>::add_and_fetch(D volatile* dest, I add_value, |
132 atomic_memory_order order) const { |
132 atomic_memory_order order) const { |
133 STATIC_ASSERT(8 == sizeof(I)); |
133 STATIC_ASSERT(8 == sizeof(I)); |
134 STATIC_ASSERT(8 == sizeof(D)); |
134 STATIC_ASSERT(8 == sizeof(D)); |
135 |
135 |
136 D result; |
136 D result; |