OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkTemplates_DEFINED | 10 #ifndef SkTemplates_DEFINED |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 template <typename T> inline T&& forward(remove_reference_t<T>& t) /*noexcept*/
{ | 37 template <typename T> inline T&& forward(remove_reference_t<T>& t) /*noexcept*/
{ |
38 return static_cast<T&&>(t); | 38 return static_cast<T&&>(t); |
39 } | 39 } |
40 template <typename T> inline T&& forward(remove_reference_t<T>&& t) /*noexcept*/
{ | 40 template <typename T> inline T&& forward(remove_reference_t<T>&& t) /*noexcept*/
{ |
41 static_assert(!is_lvalue_reference<T>::value, | 41 static_assert(!is_lvalue_reference<T>::value, |
42 "Forwarding an rvalue reference as an lvalue reference is not
allowed."); | 42 "Forwarding an rvalue reference as an lvalue reference is not
allowed."); |
43 return static_cast<T&&>(t); | 43 return static_cast<T&&>(t); |
44 } | 44 } |
45 | 45 |
| 46 template <typename T> add_rvalue_reference_t<T> declval(); |
| 47 |
46 } // namespace skstd | 48 } // namespace skstd |
47 | 49 |
48 ///@{ | 50 ///@{ |
49 /** SkTConstType<T, CONST>::type will be 'const T' if CONST is true, 'T' otherwi
se. */ | 51 /** SkTConstType<T, CONST>::type will be 'const T' if CONST is true, 'T' otherwi
se. */ |
50 template <typename T, bool CONST> struct SkTConstType { | 52 template <typename T, bool CONST> struct SkTConstType { |
51 typedef T type; | 53 typedef T type; |
52 }; | 54 }; |
53 template <typename T> struct SkTConstType<T, true> { | 55 template <typename T> struct SkTConstType<T, true> { |
54 typedef const T type; | 56 typedef const T type; |
55 }; | 57 }; |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 * Returns void* because this object does not initialize the | 550 * Returns void* because this object does not initialize the |
549 * memory. Use placement new for types that require a cons. | 551 * memory. Use placement new for types that require a cons. |
550 */ | 552 */ |
551 void* get() { return fStorage.get(); } | 553 void* get() { return fStorage.get(); } |
552 const void* get() const { return fStorage.get(); } | 554 const void* get() const { return fStorage.get(); } |
553 private: | 555 private: |
554 SkAlignedSStorage<sizeof(T)*N> fStorage; | 556 SkAlignedSStorage<sizeof(T)*N> fStorage; |
555 }; | 557 }; |
556 | 558 |
557 #endif | 559 #endif |
OLD | NEW |