Skip to content

Make common cppv ushr build on cpp03#453

Merged
tjpalmer merged 1 commit into
mainfrom
fix-cpp03-ushr
Jul 2, 2026
Merged

Make common cppv ushr build on cpp03#453
tjpalmer merged 1 commit into
mainfrom
fix-cpp03-ushr

Conversation

@tjpalmer

@tjpalmer tjpalmer commented Jul 1, 2026

Copy link
Copy Markdown
Contributor
  • Not sure ushr actually gets tested so far, but this at least builds under c++03 for funtests that we let run
  • Future PRs need to figure out how much of new be-cpp is compatible with c++03 since we need to retire be-cppv
    • Worst case, any c++03 support is mostly independent and somewhat incompatible with be-cpp libraries
  • We also still need to see if any ideas of be-cppv should be folded into be-cpp
  • This PR is just a minimal change to get c++03 working again

Signed-off-by: Tom <tom@temper.systems>
constexpr int shift_size_mask = (sizeof(T) * CHAR_BIT) - 1;
return (T) (((typename std::make_unsigned<T>::type) i) >> (j & shift_size_mask));
int shift_size_mask = (sizeof(T) * CHAR_BIT) - 1;
return (T) (to_unsigned(i) >> (j & shift_size_mask));

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.

Need c++11 for both constexpr and type_traits.

@tjpalmer tjpalmer marked this pull request as ready for review July 1, 2026 21:54
@tjpalmer tjpalmer merged commit dd81837 into main Jul 2, 2026
2 checks passed
@tjpalmer tjpalmer deleted the fix-cpp03-ushr branch July 2, 2026 14:54
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.

2 participants