@@ -165,18 +165,15 @@ class DataBox {
165
165
// Index operators
166
166
// examle calls:
167
167
// T x = db(n4, n3, n2, n1);
168
- template <typename ... Args,
169
- typename transform_t = Transform, // only for SFINAE
170
- typename std::enable_if<std::is_same<
171
- transform_t , TransformLinear>::value>::type * = nullptr >
172
- PORTABLE_INLINE_FUNCTION T &operator ()(Args... args) {
173
- return dataView_ (std::forward<Args>(args)...);
174
- }
175
- template <typename ... Args,
176
- typename transform_t = Transform, // only for SFINAE
177
- typename std::enable_if<std::is_same<
178
- transform_t , TransformLinear>::value>::type * = nullptr >
168
+ template <typename ... Args>
179
169
PORTABLE_INLINE_FUNCTION T &operator ()(Args... args) const {
170
+ static_assert (std::is_same<Transform, TransformLinear>::value,
171
+ " DataBox::operator() is only available if the independent "
172
+ " variable data transform is Spiner::TransformLinear, because "
173
+ " otherwise accessing the underlying data is not doing what you "
174
+ " expect. Use DataBox::get_data_value and DataBox::set_data_value "
175
+ " instead, because those correctly account for the independent "
176
+ " value data transformation." );
180
177
return dataView_ (std::forward<Args>(args)...);
181
178
}
182
179
0 commit comments