Skip to content
Snippets Groups Projects
Commit d1879476 authored by Laurențiu Nicola's avatar Laurențiu Nicola
Browse files

ENH: Use std::move instead of boost::move

parent 61e8f514
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ inline
/*virtual*/
void
otb::DefaultGeometriesToGeometriesFilter<TransformationFunctor, FieldTransformationPolicy>::DoProcessLayer(otb::ogr::Layer const& source,
otb::ogr::Layer& destination) const
otb::ogr::Layer& destination) const
{
if (source != destination)
{
......@@ -83,15 +83,14 @@ inline void otb::TransformationFunctorDispatcher<TransformationFunctor, otb::ogr
/*===========================================================================*/
template <class TransformationFunctor, class FieldTransformationPolicy>
inline void otb::TransformationFunctorDispatcher<TransformationFunctor, OGRGeometry, FieldTransformationPolicy>::operator()(otb::ogr::Layer const& in,
otb::ogr::Layer& out) const
otb::ogr::Layer& out) const
{
OGRFeatureDefn& defn = out.GetLayerDefn();
for (ogr::Layer::const_iterator b = in.begin(), e = in.end(); b != e; ++b)
{
ogr::Feature const feat = *b;
ogr::UniqueGeometryPtr g = m_functor(feat.GetGeometry());
ogr::Feature dest(defn);
dest.SetGeometryDirectly(otb::move(g));
ogr::Feature const feat = *b;
ogr::Feature dest(defn);
dest.SetGeometryDirectly(m_functor(feat.GetGeometry()));
this->fieldsTransform(feat, dest);
out.CreateFeature(dest);
}
......@@ -108,8 +107,7 @@ inline void otb::TransformationFunctorDispatcher<TransformationFunctor, OGRGeome
{
ogr::Feature feat = *inout.start_at(i);
this->fieldsTransform(feat);
ogr::UniqueGeometryPtr g = m_functor(feat.GetGeometry());
feat.SetGeometryDirectly(otb::move(g));
feat.SetGeometryDirectly(m_functor(feat.GetGeometry()));
inout.SetFeature(feat);
}
}
......
......@@ -26,21 +26,7 @@
/*===========================================================================*/
#include "otbOGRFeatureWrapper.h"
#include <cassert>
#include <boost/version.hpp>
#if BOOST_VERSION >= 104800
#include <boost/move/move.hpp> // since 1.48
#else
#include <boost/interprocess/detail/move.hpp>
#endif
namespace otb
{
#if BOOST_VERSION >= 104800
using boost::move;
#else
using boost::interprocess::move;
#endif
}
#include <utility>
/*===========================================================================*/
/*================================[ Feature ]================================*/
......@@ -141,7 +127,7 @@ inline void otb::ogr::Feature::SetGeometryDirectly(UniqueGeometryPtr geometry)
#if !defined(NDEBUG)
OGRGeometry* g = geometry.get();
#endif
UncheckedSetGeometryDirectly(otb::move(geometry));
UncheckedSetGeometryDirectly(std::move(geometry));
assert((m_Feature->GetGeometryRef() == g) && "The new geometry hasn't been set as expected");
assert(!geometry && "UniqueGeometryPtr hasn't released its pointer");
}
......@@ -151,7 +137,7 @@ inline otb::ogr::UniqueGeometryPtr otb::ogr::Feature::StealGeometry()
CheckInvariants();
UniqueGeometryPtr res = UncheckedStealGeometry();
itkAssertOrThrowMacro(!m_Feature->GetGeometryRef(), "Geometry hasn't been properly stolen");
return otb::move(res);
return res;
}
inline void otb::ogr::Feature::SetGeometry(OGRGeometry const* geometry)
......
......@@ -827,7 +827,7 @@ BOOST_AUTO_TEST_CASE(Add_n_Read_Geometries)
BOOST_REQUIRE(p);
BOOST_CHECK(!f.GetGeometry());
BOOST_CHECK(ogr::Equals(*p, ref));
f.SetGeometryDirectly(otb::move(p));
f.SetGeometryDirectly(std::move(p));
BOOST_CHECK(!p);
++u;
}
......
......@@ -39,7 +39,7 @@ inline otb::ogr::UniqueGeometryPtr otb::internal::ReprojectTransformationFunctor
if (out)
m_Reprojector.do_transform(*out);
ogr::UniqueGeometryPtr res(out.release());
return otb::move(res);
return res;
}
template <typename TGeometry>
......
......@@ -136,8 +136,7 @@ void otb::internal::ReprojectTransformationFunctor::do_transform(OGRGeometryColl
otb::ogr::UniqueGeometryPtr otb::internal::ReprojectTransformationFunctor::operator()(OGRGeometry const* in) const
// otb::internal::ReprojectTransformationFunctor::apply(OGRGeometry const* in) const
{
otb::ogr::UniqueGeometryPtr res = ogr::apply<otb::ogr::UniqueGeometryPtr>(in, ByCopy(*this));
return otb::move(res);
return ogr::apply<otb::ogr::UniqueGeometryPtr>(in, ByCopy(*this));
}
void otb::internal::ReprojectTransformationFunctor::apply_inplace(OGRGeometry* inout) const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment