|
From: Ivan K. <ik...@di...> - 2026-04-26 12:09:10
|
Hello,
In order to keep the R wrapper for liborigin portable to different
versions of R, I've tested it with different versions of the C++
standard. (Old versions of R know nothing about C++ > 11; new versions
default to C++20 but still allow C++17 if specifically asked [1].) It
turns out that the current code in OriginAnyParser.cpp fails to compile
in C++20 or C++23 mode due to the != operator resolution ambiguity for
tree::iterator [2]. Only a small change is needed to fix the
compilation error:
diff --git a/OriginAnyParser.cpp b/OriginAnyParser.cpp
index 209ec7f..bdd50e7 100644
--- a/OriginAnyParser.cpp
+++ b/OriginAnyParser.cpp
@@ -3259,7 +3259,7 @@ void OriginAnyParser::outputProjectTree(std::ostream &out)
out << "Origin project Tree" << endl;
char cdsz[21];
- for (tree<ProjectNode>::iterator it = projectTree.begin(projectTree.begin());
+ for (tree<ProjectNode>::sibling_iterator it = projectTree.begin(projectTree.begin());
it != projectTree.end(projectTree.begin()); ++it) {
strftime(cdsz, sizeof(cdsz), "%F %T", gmtime(&(*it).creationDate));
out << string(projectTree.depth(it) - 1, ' ') << (*it).name.c_str() << "\t" << cdsz << endl;
--
Best regards,
Ivan
[1]
https://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Using-C_002b_002b-code
[2]
https://www.r-project.org/nosvn/R.check/r-release-macos-x86_64/Ropj-00install.html
|