equal
deleted
inserted
replaced
29 |
29 |
30 template<size_t byte_size> |
30 template<size_t byte_size> |
31 struct Atomic::PlatformAdd |
31 struct Atomic::PlatformAdd |
32 : Atomic::AddAndFetch<Atomic::PlatformAdd<byte_size> > |
32 : Atomic::AddAndFetch<Atomic::PlatformAdd<byte_size> > |
33 { |
33 { |
34 template<typename I, typename D> |
34 template<typename D, typename I> |
35 D add_and_fetch(I add_value, D volatile* dest, atomic_memory_order order) const; |
35 D add_and_fetch(D volatile* dest, I add_value, atomic_memory_order order) const; |
36 }; |
36 }; |
37 |
37 |
38 template<> |
38 template<> |
39 template<typename I, typename D> |
39 template<typename D, typename I> |
40 inline D Atomic::PlatformAdd<4>::add_and_fetch(I add_value, D volatile* dest, |
40 inline D Atomic::PlatformAdd<4>::add_and_fetch(D volatile* dest, I add_value, |
41 atomic_memory_order order) const { |
41 atomic_memory_order order) const { |
42 STATIC_ASSERT(4 == sizeof(I)); |
42 STATIC_ASSERT(4 == sizeof(I)); |
43 STATIC_ASSERT(4 == sizeof(D)); |
43 STATIC_ASSERT(4 == sizeof(D)); |
44 |
44 |
45 D rv; |
45 D rv; |
57 : "memory", "o2", "o3"); |
57 : "memory", "o2", "o3"); |
58 return rv; |
58 return rv; |
59 } |
59 } |
60 |
60 |
61 template<> |
61 template<> |
62 template<typename I, typename D> |
62 template<typename D, typename I> |
63 inline D Atomic::PlatformAdd<8>::add_and_fetch(I add_value, D volatile* dest, |
63 inline D Atomic::PlatformAdd<8>::add_and_fetch(D volatile* dest, I add_value, |
64 atomic_memory_order order) const { |
64 atomic_memory_order order) const { |
65 STATIC_ASSERT(8 == sizeof(I)); |
65 STATIC_ASSERT(8 == sizeof(I)); |
66 STATIC_ASSERT(8 == sizeof(D)); |
66 STATIC_ASSERT(8 == sizeof(D)); |
67 |
67 |
68 D rv; |
68 D rv; |