Skip to content

Conversation

JJCUBER
Copy link
Contributor

@JJCUBER JJCUBER commented Sep 11, 2025

using std::size() to be more consistent with usage of std::begin() and std::end()

using `std::size()` to be more consistent with usage of `std::begin()` and `std::end()`
@JJCUBER
Copy link
Contributor Author

JJCUBER commented Sep 11, 2025

It seems that unfortunately functions with the name size cause resolution to fail. The fix is :: but I don't know if that would be considered worth it.

@simonlindholm
Copy link
Member

I'm on the fence here... I feel already with the all macro that begin and end tend to collide with things and it's unclear if they are worth it. Maybe :: is the solution there as well, just a bit ugly. I wonder if #define sz (int)::size would trigger errors in practice from variables being named sz. Will be nice when C++20 is generally usable and we can go with ssize instead of (int)size, which shouldn't have the same name collision problems.

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