diff --git a/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h b/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h index 2245455018168e85db7c63376f46cfbe289568d9..f1ba1c682b18eaef0b9d13b67f516b83380ca00b 100644 --- a/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h +++ b/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h @@ -300,8 +300,8 @@ public: Value & dereference() const { return m_Crt; } - otb::ogr::Layer * m_Layer; - otb::ogr::Feature m_Crt; + otb::ogr::Layer * m_Layer; + otb::ogr::Feature mutable m_Crt; }; template <class> friend class feature_iter; diff --git a/Testing/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapperNew.cxx b/Testing/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapperNew.cxx index 1e584a0436668c0c0e2358635c325b3c8dceb97e..edbd4e01240f7f5ca7e8429b1c960e8322c7fcf7 100644 --- a/Testing/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapperNew.cxx +++ b/Testing/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapperNew.cxx @@ -227,6 +227,8 @@ BOOST_AUTO_TEST_CASE(Add_n_Read_Fields) f0.SetValue(42); BOOST_ASSERT(f0.HasBeenSet()); BOOST_CHECK_EQUAL(f0.GetValue<int>(), 42); + BOOST_CHECK_EQUAL(g0[0].GetValue<int>(), 42); + BOOST_CHECK_EQUAL((*l.begin())[0].GetValue<int>(), 42); // BOOST_CHECK_assert_FAILS(f0.GetValue<double>(), itk::ExceptionObject); ogr::Field f1 = g0["OFTReal"];