OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 * | 6 * |
7 * | 7 * |
8 * This header provides some of the helpers (like std::enable_if_t) which will | 8 * This header provides some of the helpers (like std::enable_if_t) which will |
9 * become available with C++14 in the type_traits header (in the skstd | 9 * become available with C++14 in the type_traits header (in the skstd |
10 * namespace). This header also provides several Skia specific additions such | 10 * namespace). This header also provides several Skia specific additions such |
(...skipping 12 matching lines...) Expand all Loading... | |
23 | 23 |
24 namespace skstd { | 24 namespace skstd { |
25 | 25 |
26 template <bool B> using bool_constant = std::integral_constant<bool, B>; | 26 template <bool B> using bool_constant = std::integral_constant<bool, B>; |
27 | 27 |
28 template <bool B, typename T, typename F> using conditional_t = typename std::co nditional<B, T, F>::type; | 28 template <bool B, typename T, typename F> using conditional_t = typename std::co nditional<B, T, F>::type; |
29 template <bool B, typename T = void> using enable_if_t = typename std::enable_if <B, T>::type; | 29 template <bool B, typename T = void> using enable_if_t = typename std::enable_if <B, T>::type; |
30 | 30 |
31 template <typename T> using remove_const_t = typename std::remove_const<T>::type ; | 31 template <typename T> using remove_const_t = typename std::remove_const<T>::type ; |
32 template <typename T> using remove_volatile_t = typename std::remove_volatile<T> ::type; | 32 template <typename T> using remove_volatile_t = typename std::remove_volatile<T> ::type; |
33 template <typename T> using remove_cv_t = typename std::remove_cv<T>::type; | 33 template <typename T> using remove_cv_t = typename std::remove_cv<T>::type; |
robertphillips
2016/02/08 13:13:16
remove the new spaces ?
bsalomon
2016/02/08 14:52:54
Done.
| |
34 template <typename T> using remove_pointer_t = typename std::remove_pointer<T>:: type; | 34 template <typename T> using remove_pointer_t = typename std::remove_pointer< T>::type; |
35 template <typename T> using remove_reference_t = typename std::remove_reference< T>::type; | 35 template <typename T> using remove_reference_t = typename std::remove_reference< T>::type; |
36 template <typename T> using remove_extent_t = typename std::remove_extent<T>::ty pe; | 36 template <typename T> using remove_extent_t = typename std::remove_extent<T>::ty pe; |
37 | 37 |
38 // template<typename R, typename... Args> struct is_function< | 38 // template<typename R, typename... Args> struct is_function< |
39 // R [calling-convention] (Args...[, ...]) [const] [volatile] [&|&&]> : std: :true_type {}; | 39 // R [calling-convention] (Args...[, ...]) [const] [volatile] [&|&&]> : std: :true_type {}; |
40 // The cv and ref-qualified versions are strange types we're currently avoiding, so not supported. | 40 // The cv and ref-qualified versions are strange types we're currently avoiding, so not supported. |
41 // These aren't supported in msvc either until vs2015u2. | 41 // These aren't supported in msvc either until vs2015u2. |
42 // On all platforms, variadic functions only exist in the c calling convention. | 42 // On all platforms, variadic functions only exist in the c calling convention. |
43 // mcvc 2013 introduced __vectorcall, but it wan't until 2015 that it was added to is_function. | 43 // mcvc 2013 introduced __vectorcall, but it wan't until 2015 that it was added to is_function. |
44 template <typename> struct is_function : std::false_type {}; | 44 template <typename> struct is_function : std::false_type {}; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 template <typename D, typename S> using same_volatile_t = typename same_volatile <D, S>::type; | 118 template <typename D, typename S> using same_volatile_t = typename same_volatile <D, S>::type; |
119 template <typename D, typename S> using same_cv = copy_cv<skstd::remove_cv_t<D>, S>; | 119 template <typename D, typename S> using same_cv = copy_cv<skstd::remove_cv_t<D>, S>; |
120 template <typename D, typename S> using same_cv_t = typename same_cv<D, S>::type ; | 120 template <typename D, typename S> using same_cv_t = typename same_cv<D, S>::type ; |
121 | 121 |
122 } // namespace sknonstd | 122 } // namespace sknonstd |
123 | 123 |
124 // Just a pithier wrapper for enable_if_t. | 124 // Just a pithier wrapper for enable_if_t. |
125 #define SK_WHEN(condition, T) skstd::enable_if_t<!!(condition), T> | 125 #define SK_WHEN(condition, T) skstd::enable_if_t<!!(condition), T> |
126 | 126 |
127 #endif | 127 #endif |
OLD | NEW |