Commit 3f08e8a8 authored by Cédric Traizet's avatar Cédric Traizet

ENH: replaced boost::bind by lambdas

parent aed9feec
......@@ -108,7 +108,7 @@ char const* DeduceDriverName(std::string filename)
ExtensionDriverAssociation const* whichIt =
std::find_if(
boost::begin(k_ExtensionDriverMap), boost::end(k_ExtensionDriverMap),
boost::bind(&ExtensionDriverAssociation::Matches, _1, extension));
[&](auto const & x) { return x.Matches(extension); } );
if (whichIt == boost::end(k_ExtensionDriverMap))
{
return nullptr; // nothing found
......
......@@ -43,7 +43,7 @@
otb::ogr::Feature::Feature(OGRFeatureDefn & definition)
: m_Feature(
OGRFeature::CreateFeature(&definition),
boost::bind(&OGRFeature::DestroyFeature, _1))
[&](auto const & x) {return OGRFeature::DestroyFeature(x);})
{
CheckInvariants();
}
......@@ -52,7 +52,7 @@ otb::ogr::Feature::Feature(OGRFeature * feature)
{
if (feature)
{
m_Feature.reset(feature, boost::bind(&OGRFeature::DestroyFeature, _1));
m_Feature.reset(feature, [&](auto const & x) {return OGRFeature::DestroyFeature(x);});
}
// else default is perfect -> delete null
}
......
......@@ -70,7 +70,7 @@ otb::ogr::Layer::Layer(OGRLayer* layer, bool modifiable)
}
otb::ogr::Layer::Layer(OGRLayer* layer, GDALDataset& sourceInChargeOfLifeTime, bool modifiable)
: m_Layer(layer, boost::bind(&GDALDataset::ReleaseResultSet, boost::ref(sourceInChargeOfLifeTime), _1))
: m_Layer(layer, [&](auto const& x) { return sourceInChargeOfLifeTime.ReleaseResultSet(x); })
, m_Modifiable(modifiable)
{
assert(layer && "A null OGRlayer cannot belong to an OGRDataSource" );
......
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