diff options
author | Jose <pepone@users.noreply.github.com> | 2021-12-28 21:27:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-28 21:27:53 +0100 |
commit | bc2762ed4c196ff500ad49bb9e5039e826762045 (patch) | |
tree | 0703cb36a831353f29bfae8e53608f0f88e1e945 /cpp/src/slice2cpp/Gen.cpp | |
parent | Update C++ tests to support building with v143 binary distribution (diff) | |
download | ice-bc2762ed4c196ff500ad49bb9e5039e826762045.tar.bz2 ice-bc2762ed4c196ff500ad49bb9e5039e826762045.tar.xz ice-bc2762ed4c196ff500ad49bb9e5039e826762045.zip |
Fixes for C++98 mapping build with C++17 mode or greater
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 0b6c01ac6e7..220b5ccb70f 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -3077,7 +3077,11 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) ClassList allBases = p->allBases(); StringList ids; +#ifdef ICE_CPP11_COMPILER + transform(allBases.begin(), allBases.end(), back_inserter(ids), [](const auto& it) { return it->scoped(); }); +#else transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun(&Contained::scoped)); +#endif StringList other; other.push_back(p->scoped()); other.push_back("::Ice::Object"); @@ -3217,9 +3221,12 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) if(!allOps.empty()) { StringList allOpNames; +#ifdef ICE_CPP11_COMPILER + transform(allOps.begin(), allOps.end(), back_inserter(allOpNames), [](const auto& it) { return it->name(); }); +#else transform(allOps.begin(), allOps.end(), back_inserter(allOpNames), ::IceUtil::constMemFun(&Contained::name)); - +#endif allOpNames.push_back("ice_id"); allOpNames.push_back("ice_ids"); allOpNames.push_back("ice_isA"); @@ -6163,7 +6170,11 @@ Slice::Gen::Cpp11DeclVisitor::visitClassDefStart(const ClassDefPtr& p) ClassList allBases = p->allBases(); StringList ids; +#ifdef ICE_CPP11_COMPILER + transform(allBases.begin(), allBases.end(), back_inserter(ids), [](const auto& it) { return it->scoped(); }); +#else transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun(&Contained::scoped)); +#endif StringList other; other.push_back(p->scoped()); other.push_back("::Ice::Object"); @@ -6184,7 +6195,11 @@ Slice::Gen::Cpp11DeclVisitor::visitClassDefStart(const ClassDefPtr& p) C << eb << ';'; StringList allOpNames; +#ifdef ICE_CPP11_COMPILER + transform(allOps.begin(), allOps.end(), back_inserter(allOpNames), [](const auto& it) { return it->name(); }); +#else transform(allOps.begin(), allOps.end(), back_inserter(allOpNames), ::IceUtil::constMemFun(&Contained::name)); +#endif allOpNames.push_back("ice_id"); allOpNames.push_back("ice_ids"); allOpNames.push_back("ice_isA"); @@ -7978,7 +7993,11 @@ Slice::Gen::Cpp11InterfaceVisitor::visitClassDefStart(const ClassDefPtr& p) ClassList allBases = p->allBases(); StringList ids; +#ifdef ICE_CPP11_COMPILER + transform(allBases.begin(), allBases.end(), back_inserter(ids), [](const auto& it) { return it->scoped(); }); +#else transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun(&Contained::scoped)); +#endif StringList other; other.push_back(p->scoped()); other.push_back("::Ice::Object"); @@ -8076,7 +8095,11 @@ Slice::Gen::Cpp11InterfaceVisitor::visitClassDefEnd(const ClassDefPtr& p) if(!allOps.empty()) { StringList allOpNames; +#ifdef ICE_CPP11_COMPILER + transform(allOps.begin(), allOps.end(), back_inserter(allOpNames), [](const auto& it) { return it->name(); }); +#else transform(allOps.begin(), allOps.end(), back_inserter(allOpNames), ::IceUtil::constMemFun(&Contained::name)); +#endif allOpNames.push_back("ice_id"); allOpNames.push_back("ice_ids"); allOpNames.push_back("ice_isA"); |