OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CC_INPUT_SELECTION_H_ | 5 #ifndef CC_INPUT_SELECTION_H_ |
6 #define CC_INPUT_SELECTION_H_ | 6 #define CC_INPUT_SELECTION_H_ |
7 | 7 |
8 #include "cc/base/cc_export.h" | 8 #include "cc/cc_export.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
11 | 11 |
12 template <typename BoundType> | 12 template <typename BoundType> |
13 struct CC_EXPORT Selection { | 13 struct CC_EXPORT Selection { |
14 Selection() {} | 14 Selection() {} |
15 ~Selection() {} | 15 ~Selection() {} |
16 | 16 |
17 BoundType start, end; | 17 BoundType start, end; |
18 }; | 18 }; |
19 | 19 |
20 template <typename BoundType> | 20 template <typename BoundType> |
21 inline bool operator==(const Selection<BoundType>& lhs, | 21 inline bool operator==(const Selection<BoundType>& lhs, |
22 const Selection<BoundType>& rhs) { | 22 const Selection<BoundType>& rhs) { |
23 return lhs.start == rhs.start && lhs.end == rhs.end; | 23 return lhs.start == rhs.start && lhs.end == rhs.end; |
24 } | 24 } |
25 | 25 |
26 template <typename BoundType> | 26 template <typename BoundType> |
27 inline bool operator!=(const Selection<BoundType>& lhs, | 27 inline bool operator!=(const Selection<BoundType>& lhs, |
28 const Selection<BoundType>& rhs) { | 28 const Selection<BoundType>& rhs) { |
29 return !(lhs == rhs); | 29 return !(lhs == rhs); |
30 } | 30 } |
31 | 31 |
32 } // namespace cc | 32 } // namespace cc |
33 | 33 |
34 #endif // CC_INPUT_SELECTION_H_ | 34 #endif // CC_INPUT_SELECTION_H_ |
OLD | NEW |