From: Minmin Gong Date: Wed, 5 Jul 2017 00:01:03 +0000 (-0700) Subject: Remove std functions deprecated by C++11. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4efe7bfd41588ae8e8717f4f28c8ced7ef7ccfaf;p=platform%2Fupstream%2Fassimp.git Remove std functions deprecated by C++11. --- diff --git a/code/BlenderModifier.cpp b/code/BlenderModifier.cpp index 161028b..a1ccba5 100644 --- a/code/BlenderModifier.cpp +++ b/code/BlenderModifier.cpp @@ -266,7 +266,7 @@ void BlenderModifier_Mirror :: DoIt(aiNode& out, ConversionData& conv_data, co std::copy(out.mMeshes,out.mMeshes+out.mNumMeshes,nind); std::transform(out.mMeshes,out.mMeshes+out.mNumMeshes,nind+out.mNumMeshes, - std::bind1st(std::plus< unsigned int >(),out.mNumMeshes)); + [&out](unsigned int n) { return out.mNumMeshes + n; }); delete[] out.mMeshes; out.mMeshes = nind; diff --git a/code/FBXDocument.cpp b/code/FBXDocument.cpp index d2f26c4..9b6e737 100644 --- a/code/FBXDocument.cpp +++ b/code/FBXDocument.cpp @@ -565,7 +565,7 @@ std::vector Document::GetConnectionsSequenced(uint64_t id, temp.push_back((*it).second); } - std::sort(temp.begin(), temp.end(), std::mem_fun(&Connection::Compare)); + std::sort(temp.begin(), temp.end(), std::mem_fn(&Connection::Compare)); return temp; // NRVO should handle this } @@ -617,7 +617,7 @@ std::vector Document::GetConnectionsSequenced(uint64_t id, bo temp.push_back((*it).second); } - std::sort(temp.begin(), temp.end(), std::mem_fun(&Connection::Compare)); + std::sort(temp.begin(), temp.end(), std::mem_fn(&Connection::Compare)); return temp; // NRVO should handle this } diff --git a/code/FBXMeshGeometry.cpp b/code/FBXMeshGeometry.cpp index 63de946..3a57cfd 100644 --- a/code/FBXMeshGeometry.cpp +++ b/code/FBXMeshGeometry.cpp @@ -357,7 +357,7 @@ void MeshGeometry::ReadVertexData(const std::string& type, int index, const Scop // avoids losing the material if there are more material layers // coming of which at least one contains actual data (did observe // that with one test file). - const size_t count_neg = std::count_if(temp_materials.begin(),temp_materials.end(),std::bind2nd(std::less(),0)); + const size_t count_neg = std::count_if(temp_materials.begin(),temp_materials.end(),[](int n) { return n < 0; }); if(count_neg == temp_materials.size()) { FBXImporter::LogWarn("ignoring dummy material layer (all entries -1)"); return; diff --git a/code/LWOAnimation.cpp b/code/LWOAnimation.cpp index 4862876..61c6964 100644 --- a/code/LWOAnimation.cpp +++ b/code/LWOAnimation.cpp @@ -164,7 +164,7 @@ void AnimResolver::UpdateAnimRangeSetup() { const double start_time = delta - std::fmod(my_first-first,delta); std::vector::iterator n = std::find_if((*it).keys.begin(),(*it).keys.end(), - std::bind1st(std::greater(),start_time)),m; + [start_time](double t) { return start_time > t; }),m; size_t ofs = 0; if (n != (*it).keys.end()) { diff --git a/code/OgreParsingUtils.h b/code/OgreParsingUtils.h index d189537..b0c31e5 100644 --- a/code/OgreParsingUtils.h +++ b/code/OgreParsingUtils.h @@ -91,11 +91,11 @@ static inline std::string &TrimLeft(std::string &s, bool newlines = true) { if (!newlines) { - s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(Assimp::IsSpace)))); + s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](char c) { return !Assimp::IsSpace(c); })); } else { - s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(Assimp::IsSpaceOrNewLine)))); + s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](char c) { return !Assimp::IsSpaceOrNewLine(c); })); } return s; } @@ -105,11 +105,11 @@ static inline std::string &TrimRight(std::string &s, bool newlines = true) { if (!newlines) { - s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun(Assimp::IsSpace))).base(),s.end()); + s.erase(std::find_if(s.rbegin(), s.rend(), [](char c) { return !Assimp::IsSpace(c); }).base(),s.end()); } else { - s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(Assimp::IsSpaceOrNewLine)))); + s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](char c) { return !Assimp::IsSpaceOrNewLine(c); })); } return s; }