@@ -30,10 +30,10 @@ namespace gridtools {
30
30
tuple_leaf &operator =(tuple_leaf const &) = default ;
31
31
tuple_leaf &operator =(tuple_leaf &&) = default ;
32
32
33
- constexpr GT_FUNCTION tuple_leaf () noexcept : m_value() {}
33
+ GT_CONSTEXPR GT_FUNCTION tuple_leaf () noexcept : m_value() {}
34
34
35
35
template <class Arg , enable_if_t <std::is_constructible<T, Arg &&>::value, int > = 0 >
36
- constexpr GT_FUNCTION tuple_leaf (Arg &&arg) noexcept : m_value(wstd::forward<Arg>(arg)) {}
36
+ GT_CONSTEXPR GT_FUNCTION tuple_leaf (Arg &&arg) noexcept : m_value(wstd::forward<Arg>(arg)) {}
37
37
};
38
38
39
39
template <size_t I, class T >
@@ -45,12 +45,12 @@ namespace gridtools {
45
45
tuple_leaf &operator =(tuple_leaf &&) = default ;
46
46
47
47
template <class Arg , enable_if_t <std::is_constructible<T, Arg &&>::value, int > = 0 >
48
- constexpr GT_FUNCTION tuple_leaf (Arg &&arg) noexcept : T(wstd::forward<Arg>(arg)) {}
48
+ GT_CONSTEXPR GT_FUNCTION tuple_leaf (Arg &&arg) noexcept : T(wstd::forward<Arg>(arg)) {}
49
49
};
50
50
51
51
struct tuple_leaf_getter {
52
52
template <size_t I, class T >
53
- static constexpr GT_FUNCTION T const &get (tuple_leaf<I, T, false > const &obj) noexcept {
53
+ static GT_CONSTEXPR GT_FUNCTION T const &get (tuple_leaf<I, T, false > const &obj) noexcept {
54
54
return obj.m_value ;
55
55
}
56
56
@@ -60,12 +60,12 @@ namespace gridtools {
60
60
}
61
61
62
62
template <size_t I, class T >
63
- static constexpr GT_FUNCTION T &&get(tuple_leaf<I, T, false > &&obj) noexcept {
64
- return static_cast <T &&>(obj. m_value );
63
+ static GT_CONSTEXPR GT_FUNCTION T &&get(tuple_leaf<I, T, false > &&obj) noexcept {
64
+ return static_cast <T &&>(get<I>( obj) );
65
65
}
66
66
67
67
template <size_t I, class T >
68
- static constexpr GT_FUNCTION T const &get (tuple_leaf<I, T, true > const &obj) noexcept {
68
+ static GT_CONSTEXPR GT_FUNCTION T const &get (tuple_leaf<I, T, true > const &obj) noexcept {
69
69
return obj;
70
70
}
71
71
@@ -75,7 +75,7 @@ namespace gridtools {
75
75
}
76
76
77
77
template <size_t I, class T >
78
- static constexpr GT_FUNCTION T &&get(tuple_leaf<I, T, true > &&obj) noexcept {
78
+ static GT_CONSTEXPR GT_FUNCTION T &&get(tuple_leaf<I, T, true > &&obj) noexcept {
79
79
return static_cast <T &&>(obj);
80
80
}
81
81
};
@@ -93,11 +93,11 @@ namespace gridtools {
93
93
tuple_impl &operator =(tuple_impl &&) = default ;
94
94
95
95
template <class ... Args>
96
- constexpr GT_FUNCTION tuple_impl (Args &&... args) noexcept
96
+ GT_CONSTEXPR GT_FUNCTION tuple_impl (Args &&... args) noexcept
97
97
: tuple_leaf<Is, Ts>(wstd::forward<Args>(args))... {}
98
98
99
99
template <class Src >
100
- constexpr GT_FUNCTION tuple_impl (Src &&src) noexcept
100
+ GT_CONSTEXPR GT_FUNCTION tuple_impl (Src &&src) noexcept
101
101
: tuple_leaf<Is, Ts>(tuple_leaf_getter::get<Is>(wstd::forward<Src>(src)))... {}
102
102
103
103
GT_FORCE_INLINE void swap (tuple_impl &other) noexcept {
@@ -118,7 +118,7 @@ namespace gridtools {
118
118
conjunction<std::is_assignable<Ts &, Args &&>...>::value,
119
119
int > = 0 >
120
120
GT_FUNCTION void assign (tuple_impl<meta::index_sequence<Is...>, Args...> &&src) noexcept {
121
- void ((int []){(tuple_leaf_getter::get<Is>(*this ) = tuple_leaf_getter::get<Is>(std ::move (src)), 0 )...});
121
+ void ((int []){(tuple_leaf_getter::get<Is>(*this ) = tuple_leaf_getter::get<Is>(wstd ::move (src)), 0 )...});
122
122
}
123
123
};
124
124
} // namespace impl_
@@ -144,15 +144,15 @@ namespace gridtools {
144
144
145
145
struct getter {
146
146
template <size_t I>
147
- static constexpr GT_FUNCTION auto get (tuple const &obj) noexcept GT_AUTO_RETURN(
147
+ static GT_CONSTEXPR GT_FUNCTION auto get (tuple const &obj) noexcept GT_AUTO_RETURN(
148
148
impl_::tuple_leaf_getter::get<I>(obj.m_impl));
149
149
150
150
template <size_t I>
151
151
static GT_FUNCTION auto get (tuple &obj) noexcept GT_AUTO_RETURN(
152
152
impl_::tuple_leaf_getter::get<I>(obj.m_impl));
153
153
154
154
template <size_t I>
155
- static constexpr GT_FUNCTION auto get (tuple &&obj) noexcept GT_AUTO_RETURN(
155
+ static GT_CONSTEXPR GT_FUNCTION auto get (tuple &&obj) noexcept GT_AUTO_RETURN(
156
156
impl_::tuple_leaf_getter::get<I>(wstd::move(obj).m_impl));
157
157
};
158
158
friend getter tuple_getter (tuple const &) { return {}; }
@@ -168,37 +168,37 @@ namespace gridtools {
168
168
tuple &operator =(tuple const &) = default ;
169
169
tuple &operator =(tuple &&) = default ;
170
170
171
- constexpr GT_FUNCTION tuple (Ts const &... args) noexcept : m_impl(args...) {}
171
+ GT_CONSTEXPR GT_FUNCTION tuple (Ts const &... args) noexcept : m_impl(args...) {}
172
172
173
173
template <class ... Args,
174
174
enable_if_t <sizeof ...(Ts) == sizeof ...(Args) && conjunction<std::is_constructible<Ts, Args &&>...>::value,
175
175
int > = 0 >
176
- constexpr GT_FUNCTION tuple (Args &&... args) noexcept : m_impl(wstd::forward<Args>(args)...) {}
176
+ GT_CONSTEXPR GT_FUNCTION tuple (Args &&... args) noexcept : m_impl(wstd::forward<Args>(args)...) {}
177
177
178
178
template <class ... Args,
179
179
enable_if_t <sizeof ...(Ts) == sizeof ...(Args) &&
180
180
conjunction<std::is_constructible<Ts, Args const &>...>::value,
181
181
int > = 0 >
182
- constexpr GT_FUNCTION tuple (tuple<Args...> const &src) noexcept : m_impl(src.m_impl) {}
182
+ GT_CONSTEXPR GT_FUNCTION tuple (tuple<Args...> const &src) noexcept : m_impl(src.m_impl) {}
183
183
184
184
template <class ... Args,
185
185
enable_if_t <sizeof ...(Ts) == sizeof ...(Args) && conjunction<std::is_constructible<Ts, Args &&>...>::value,
186
186
int > = 0 >
187
- constexpr GT_FUNCTION tuple (tuple<Args...> &&src) noexcept : m_impl(wstd::move(src).m_impl) {}
187
+ GT_CONSTEXPR GT_FUNCTION tuple (tuple<Args...> &&src) noexcept : m_impl(wstd::move(src).m_impl) {}
188
188
189
189
GT_FORCE_INLINE void swap (tuple &other) noexcept { m_impl.swap (other.m_impl ); }
190
190
191
191
template <class Other >
192
192
GT_FUNCTION auto operator =(Other &&other)
193
- GT_AUTO_RETURN ((m_impl.assign(std ::forward<Other>(other).m_impl), *this ));
193
+ GT_AUTO_RETURN ((m_impl.assign(wstd ::forward<Other>(other).m_impl), *this ));
194
194
};
195
195
196
196
template <class T >
197
197
class tuple <T> {
198
198
T m_value;
199
199
struct getter {
200
200
template <size_t I, enable_if_t <I == 0 , int > = 0 >
201
- static constexpr GT_FUNCTION T const &get (tuple const &obj) noexcept {
201
+ static GT_CONSTEXPR GT_FUNCTION T const &get (tuple const &obj) noexcept {
202
202
return obj.m_value ;
203
203
}
204
204
@@ -208,7 +208,7 @@ namespace gridtools {
208
208
}
209
209
210
210
template <size_t I, enable_if_t <I == 0 , int > = 0 >
211
- static constexpr GT_FUNCTION T &&get(tuple &&obj) noexcept {
211
+ static GT_CONSTEXPR GT_FUNCTION T &&get(tuple &&obj) noexcept {
212
212
return static_cast <T &&>(obj.m_value );
213
213
}
214
214
};
@@ -225,23 +225,23 @@ namespace gridtools {
225
225
tuple &operator =(tuple const &) = default ;
226
226
tuple &operator =(tuple &&) = default ;
227
227
228
- constexpr GT_FUNCTION tuple (T const &arg) noexcept : m_value(arg) {}
228
+ GT_CONSTEXPR GT_FUNCTION tuple (T const &arg) noexcept : m_value(arg) {}
229
229
230
230
template <class Arg , enable_if_t <std::is_constructible<T, Arg &&>::value, int > = 0 >
231
- constexpr GT_FUNCTION tuple (Arg &&arg) noexcept : m_value(wstd::forward<Arg>(arg)) {}
231
+ GT_CONSTEXPR GT_FUNCTION tuple (Arg &&arg) noexcept : m_value(wstd::forward<Arg>(arg)) {}
232
232
233
233
template <class Arg ,
234
234
enable_if_t <std::is_constructible<T, Arg const &>::value &&
235
235
!std::is_convertible<tuple<Arg> const &, T>::value &&
236
236
!std::is_constructible<T, tuple<Arg> const &>::value && !std::is_same<T, Arg>::value,
237
237
int > = 0 >
238
- constexpr GT_FUNCTION tuple (tuple<Arg> const &src) noexcept : m_value(src.m_value) {}
238
+ GT_CONSTEXPR GT_FUNCTION tuple (tuple<Arg> const &src) noexcept : m_value(src.m_value) {}
239
239
240
240
template <class Arg ,
241
241
enable_if_t <std::is_constructible<T, Arg &&>::value && !std::is_convertible<tuple<Arg>, T>::value &&
242
242
!std::is_constructible<T, tuple<Arg>>::value && !std::is_same<T, Arg>::value,
243
243
int > = 0 >
244
- constexpr GT_FUNCTION tuple (tuple<Arg> &&src) noexcept : m_value(wstd::move(src).m_value) {}
244
+ GT_CONSTEXPR GT_FUNCTION tuple (tuple<Arg> &&src) noexcept : m_value(wstd::move(src).m_value) {}
245
245
246
246
GT_FORCE_INLINE void swap (tuple &other) noexcept {
247
247
using std::swap;
@@ -256,7 +256,7 @@ namespace gridtools {
256
256
257
257
template <class Arg , enable_if_t <std::is_assignable<T &, Arg &&>::value, int > = 0 >
258
258
GT_FUNCTION tuple &operator =(tuple<Arg> &&src) noexcept {
259
- m_value = std ::move (src).m_value ;
259
+ m_value = wstd ::move (src).m_value ;
260
260
return *this ;
261
261
}
262
262
};
0 commit comments