@@ -230,24 +230,31 @@ class DataBox {
230
230
231
231
// Data array accessors
232
232
template <typename ... Args>
233
- PORTABLE_INLINE_FUNCTION T get (Args... args) {
233
+ PORTABLE_INLINE_FUNCTION T get_data_value (Args... args) const {
234
234
return Transform::reverse (dataView_ (std::forward<Args>(args)...));
235
235
}
236
+ // TODO: Should this method be const? Having this be const is in line with the second operator()
237
+ // below (the one with const), which allows the user to modify the dependent variable
238
+ // values of a const DataBox.
236
239
template <typename ... Args>
237
- PORTABLE_INLINE_FUNCTION void set (const T new_value, Args... args) {
240
+ PORTABLE_INLINE_FUNCTION void set_data_value (const T new_value, Args... args) const {
238
241
dataView_ (std::forward<Args>(args)...) = Transform::forward (new_value);
239
242
}
240
243
241
244
// Index operators
242
245
// examle calls:
243
246
// T x = db(n4, n3, n2, n1);
244
- template <typename ... Args,
245
- typename std::enable_if<std::is_same<Transform,TransformLinear>::value>::type* = nullptr >
247
+ template <
248
+ typename ... Args,
249
+ typename transform_t =Transform, // only for SFINAE
250
+ typename std::enable_if<std::is_same<transform_t ,TransformLinear>::value>::type* = nullptr >
246
251
PORTABLE_INLINE_FUNCTION T &operator ()(Args... args) {
247
252
return dataView_ (std::forward<Args>(args)...);
248
253
}
249
- template <typename ... Args,
250
- typename std::enable_if<std::is_same<Transform,TransformLinear>::value>::type* = nullptr >
254
+ template <
255
+ typename ... Args,
256
+ typename transform_t =Transform, // only for SFINAE
257
+ typename std::enable_if<std::is_same<transform_t ,TransformLinear>::value>::type* = nullptr >
251
258
PORTABLE_INLINE_FUNCTION T &operator ()(Args... args) const {
252
259
return dataView_ (std::forward<Args>(args)...);
253
260
}
0 commit comments