@@ -87,11 +87,11 @@ KERNEL_FLOAT_INLINE vector<R, extent<N>> convert(const V& input, extent<N> new_s
87
87
template <typename T, RoundingMode M = RoundingMode::ANY>
88
88
struct AssignConversionProxy {
89
89
KERNEL_FLOAT_INLINE
90
- explicit AssignConversionProxy (T* ptr) : ptr_(ptr) {}
90
+ explicit AssignConversionProxy (T&& ptr) : ptr_(std::forward<T>( ptr) ) {}
91
91
92
92
template <typename U>
93
93
KERNEL_FLOAT_INLINE AssignConversionProxy& operator =(U&& values) {
94
- * ptr_ = detail::convert_impl<
94
+ ptr_ = detail::convert_impl<
95
95
vector_value_type<U>,
96
96
vector_extent_type<U>,
97
97
vector_value_type<T>,
@@ -102,12 +102,12 @@ struct AssignConversionProxy {
102
102
}
103
103
104
104
private:
105
- T* ptr_;
105
+ T ptr_;
106
106
};
107
107
108
108
/* *
109
109
* Takes a vector reference and gives back a helper object. This object allows you to assign
110
- * a vector of a different type to another vector while perofrming implicit type converion .
110
+ * a vector of a different type to another vector while performing implicit type conversion .
111
111
*
112
112
* For example, if `x = expression;` does not compile because `x` and `expression` are
113
113
* different vector types, you can use `cast_to(x) = expression;` to make it work.
@@ -120,9 +120,9 @@ struct AssignConversionProxy {
120
120
* cast_to(x) = y; // Normally, `x = y;` would give an error, but `cast_to` fixes that.
121
121
* ```
122
122
*/
123
- template <typename T, RoundingMode M = RoundingMode::ANY>
124
- KERNEL_FLOAT_INLINE AssignConversionProxy<T, M> cast_to (T& input) {
125
- return AssignConversionProxy<T, M>(& input);
123
+ template <RoundingMode M = RoundingMode::ANY, typename T >
124
+ KERNEL_FLOAT_INLINE AssignConversionProxy<T, M> cast_to (T&& input) {
125
+ return AssignConversionProxy<T, M>(std::forward<T>( input) );
126
126
}
127
127
128
128
/* *
@@ -135,7 +135,7 @@ KERNEL_FLOAT_INLINE AssignConversionProxy<T, M> cast_to(T& input) {
135
135
* ```
136
136
*/
137
137
template <size_t N, typename T>
138
- KERNEL_FLOAT_INLINE vector<T, extent<N>> fill (T value = {} , extent<N> = {}) {
138
+ KERNEL_FLOAT_INLINE vector<T, extent<N>> fill (T value, extent<N> = {}) {
139
139
vector_storage<T, 1 > input = {value};
140
140
return detail::broadcast_impl<T, extent<1 >, extent<N>>::call (input);
141
141
}
0 commit comments