Commit c9e762e8 authored by Luc Hermitte's avatar Luc Hermitte

COM: OTB-134/OGR -> boost::move and portability

parent dc32f2f1
......@@ -22,6 +22,14 @@
/*===============================[ Includes ]================================*/
/*===========================================================================*/
#include <cassert>
#if BOOST_VERSION > 104800
# include <boost/move/move.hpp> // since 1.48
#else
# include <boost/interprocess/detail/move.hpp>
namespace boost {
using boost::interprocess::move;
} // boost namespace
#endif
/*===========================================================================*/
/*================================[ Feature ]================================*/
......@@ -129,7 +137,7 @@ void otb::ogr::Feature::SetGeometryDirectly(UniqueGeometryPtr geometry)
{
CheckInvariants();
OGRGeometry * g = geometry.get();
UncheckedSetGeometryDirectly(boost::interprocess::move(geometry));
UncheckedSetGeometryDirectly(boost::move(geometry));
assert(m_Feature->GetGeometryRef() == g && "The new geometry hasn't been set as expected");
assert(! geometry && "UniqueGeometryPtr hasn't released its pointer");
}
......@@ -140,7 +148,7 @@ otb::ogr::UniqueGeometryPtr otb::ogr::Feature::StealGeometry()
CheckInvariants();
UniqueGeometryPtr res = UncheckedStealGeometry();
assert(! m_Feature->GetGeometryRef() && "Geometry hasn't been properly stolen");
return boost::interprocess::move(res);
return boost::move(res);
}
inline
......
......@@ -264,7 +264,7 @@ typedef map
, pair<int_<OFTIntegerList>, MemberContainerSetterPtr<int, &OGRFeature::SetField> >
, pair<int_<OFTReal>, MemberSetterPtr<double, &OGRFeature::SetField> >
, pair<int_<OFTRealList>, MemberContainerSetterPtr<double, &OGRFeature::SetField> >
// , pair<int_<OFTString>, MemberSetterPtr<char const*, &OGRFeature::SetField/*, std::string*/> >
, pair<int_<OFTString>, MemberSetterPtr<char const*, &OGRFeature::SetField/*, std::string*/> >
// , pair<int_<OFTStringList>, MemberContainerSetterPtr<char const*, &OGRFeature::SetField, std::string> >
> FieldSetters_Map;
......
......@@ -79,8 +79,9 @@ struct GeometryDeleter
*
* \note You may experiment difficulties to copy \c UniqueGeometryPtr. This is
* likelly to be normal. You'll have to emulate \c std::move() with \c
* boost::interprocess::move(). Check for instance \c Feature::StealGeometry(),
* or \c Feature::SetGeometryDirectly() to see examples.
* boost::move() (with Boost v1.48+, or with \c boost::interprocess::move()
* otherwise). Check for instance \c Feature::StealGeometry(), or \c
* Feature::SetGeometryDirectly() to see examples.
*
* \internal
* This should be defined on top of C++11 \c std::unique_ptr<>. By the mean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment