@@ -136,7 +136,7 @@ namespace gt_verification {
136
136
static_assert (
137
137
std::is_same< typename FieldType::storage_t ::data_t , T >::value, " internal error: types do not match" );
138
138
139
- type_erased_field_view_base (FieldType & field) : field_(field) {}
139
+ type_erased_field_view_base (FieldType field) : field_(field) {}
140
140
141
141
virtual const T &access (int i, int j, int k) const noexcept override {
142
142
return make_host_view (field_)(i, j, k);
@@ -189,7 +189,7 @@ namespace gt_verification {
189
189
virtual void sync () noexcept override { field_.sync (); }
190
190
191
191
private:
192
- FieldType & field_;
192
+ FieldType field_;
193
193
};
194
194
195
195
template < typename FieldType, typename T >
@@ -320,15 +320,15 @@ namespace gt_verification {
320
320
* @brief Create a TypeErasedFieldView from GridTools field (stores a reference to the field)
321
321
*/
322
322
template < class FieldType >
323
- type_erased_field_view (const FieldType & field) {
323
+ type_erased_field_view (FieldType field) {
324
324
static_assert (
325
325
!internal::is_type_erased_field_view< FieldType >::value, " FieldType is not a GridTools field" );
326
326
327
327
// The const cast is ugly here but the signature of this constructor needs to be the same as
328
328
// the copy constructor. Hence, we need to capture the field by const ref.. maybe this can
329
329
// be improved.
330
330
base_ = std::make_shared< internal::type_erased_field_view_base< FieldType, T > >(
331
- const_cast < FieldType & >( field) );
331
+ field);
332
332
}
333
333
334
334
/* *
0 commit comments