OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/sync/base/immutable.h" | 5 #include "components/sync/base/immutable.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <set> | 10 #include <set> |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // Google-style swap. | 80 // Google-style swap. |
81 void Swap(TokenBase* other) { | 81 void Swap(TokenBase* other) { |
82 using std::swap; | 82 using std::swap; |
83 swap(other->core_, core_); | 83 swap(other->core_, core_); |
84 } | 84 } |
85 | 85 |
86 private: | 86 private: |
87 scoped_refptr<TokenCore> core_; | 87 scoped_refptr<TokenCore> core_; |
88 }; | 88 }; |
89 | 89 |
90 typedef TokenBase<USE_DEFAULT_SWAP> Token; | 90 using Token = TokenBase<USE_DEFAULT_SWAP>; |
91 typedef TokenBase<USE_FAST_SWAP_VIA_ADL> ADLToken; | 91 using ADLToken = TokenBase<USE_FAST_SWAP_VIA_ADL>; |
92 typedef TokenBase<USE_FAST_SWAP_VIA_SPECIALIZATION> SpecializationToken; | 92 using SpecializationToken = TokenBase<USE_FAST_SWAP_VIA_SPECIALIZATION>; |
93 | 93 |
94 void swap(ADLToken& t1, ADLToken& t2) { | 94 void swap(ADLToken& t1, ADLToken& t2) { |
95 t1.Swap(&t2); | 95 t1.Swap(&t2); |
96 } | 96 } |
97 | 97 |
98 } // namespace syncer | 98 } // namespace syncer |
99 | 99 |
100 // Allowed by the standard (17.4.3.1/1). | 100 // Allowed by the standard (17.4.3.1/1). |
101 namespace std { | 101 namespace std { |
102 | 102 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 TEST_F(ImmutableTest, List) { | 225 TEST_F(ImmutableTest, List) { |
226 RunTokenContainerTest<std::list<Token>, Immutable<std::list<Token>>>("List"); | 226 RunTokenContainerTest<std::list<Token>, Immutable<std::list<Token>>>("List"); |
227 } | 227 } |
228 | 228 |
229 TEST_F(ImmutableTest, Set) { | 229 TEST_F(ImmutableTest, Set) { |
230 RunTokenContainerTest<std::set<Token>, Immutable<std::set<Token>>>("Set"); | 230 RunTokenContainerTest<std::set<Token>, Immutable<std::set<Token>>>("Set"); |
231 } | 231 } |
232 | 232 |
233 } // namespace | 233 } // namespace |
234 } // namespace syncer | 234 } // namespace syncer |
OLD | NEW |