|
From: Stefan G. <ste...@un...> - 2026-05-15 16:35:27
|
Hello Ivan,
thanks for your report and fix. I wasn't able to reproduce the problem, but i integrated your fix now anyway.
Would it be preferable to release a new version of liborigin?
Best,
Stefan
On 4/26/26 14:08, Ivan Krylov via Liborigin-devel wrote:
> 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;
>
|