Skip to content

Conversation

@anonrig
Copy link
Member

@anonrig anonrig commented Nov 18, 2025

Fixes #856

C++11 compatible compiler. We support LLVM clang, GCC, Visual Studio. (Our tests and benchmark tools requires C++17.)

Up until the last commit in this PR, we didn't enabled C++17 on macos workflow even though our README said otherwise...

@anonrig anonrig requested a review from lemire November 18, 2025 16:07
@anonrig anonrig force-pushed the yagiz/add-simdutf-constexpr branch from f2c301a to f63b351 Compare November 18, 2025 16:13
@anonrig anonrig force-pushed the yagiz/add-simdutf-constexpr branch from f63b351 to d75c48e Compare November 18, 2025 16:17
@lemire
Copy link
Member

lemire commented Nov 18, 2025

This is reasonable. Let us wait for the tests to go green.

simdutf_really_inline void utf16fix_block(char16_t *out, const char16_t *in) {
const char16_t replacement = scalar::utf16::replacement<big_endian>();
auto swap_if_needed = [](uint16_t c) -> uint16_t {
simdutf_constexpr auto swap_if_needed = [](uint16_t c) -> uint16_t {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this feels a bit misplaced?

I think the constexpr should go inside the lambda, with the ternary replaced with an if.

Copy link
Member

Choose a reason for hiding this comment

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

@anonrig Can you answer this comment ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes this is kind of unnecessary and can be moved into the correct place.

@pauldreik
Copy link
Collaborator

A related question: what would it take for us to require C++17 instead of C++11 as build requirement? Do we have any idea of how large proportion of the simdutf users are stuck at C++11?

@lemire
Copy link
Member

lemire commented Nov 18, 2025

A related question: what would it take for us to require C++17 instead of C++11 as build requirement? Do we have any idea of how large proportion of the simdutf users are stuck at C++11?

Obviously, I would just skip to C++20 if I could. Let us see what people use:

https://x.com/lemire/status/1990885057494442176?s=20

@lemire
Copy link
Member

lemire commented Nov 18, 2025

I am blaming the failed CI tests on Cloudflare. @anonrig's PR should be generally safe.

@anonrig anonrig closed this Dec 30, 2025
@anonrig anonrig deleted the yagiz/add-simdutf-constexpr branch December 30, 2025 18:16
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.

Use if constexpr more generously

4 participants