Skip to content

fix build for old compilers (#1323)#1324

Merged
serge-sans-paille merged 1 commit intoxtensor-stack:masterfrom
hdu-sdlzx:main
Apr 26, 2026
Merged

fix build for old compilers (#1323)#1324
serge-sans-paille merged 1 commit intoxtensor-stack:masterfrom
hdu-sdlzx:main

Conversation

@hdu-sdlzx
Copy link
Copy Markdown
Contributor

version header and std::countl_one are introduced in C++20

Signed-off-by: Liu Zixian <zixian.liu@dolphindb.com>

#include <version>

#if __cpp_lib_bitops >= 201907L
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this check and the include of '' still makes sense then?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it is for compilers that were late to implement some features of the standard?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense when someone uses a compiler that does not fully support C++20.

Looks like clang(libcxx) implemented version header (P0754R2) in clang 7 and bit operations (P0553R4) in clang 9.

Reference: https://libcxx.llvm.org/Status/Cxx20.html

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, let's live with it for a while then.

@serge-sans-paille
Copy link
Copy Markdown
Contributor

Thanks. It's quite strange that our CI didn't catch it though.

@hdu-sdlzx
Copy link
Copy Markdown
Contributor Author

The CI failure looks unrelated to this PR, try to fix it with #1327

@serge-sans-paille serge-sans-paille merged commit 9ce5347 into xtensor-stack:master Apr 26, 2026
72 of 75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants