kactl icon indicating copy to clipboard operation
kactl copied to clipboard

Make function syntax consistent in template

Open JJCUBER opened this issue 3 months ago • 2 comments

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

JJCUBER avatar Sep 11 '25 19:09 JJCUBER

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.

JJCUBER avatar Sep 11 '25 19:09 JJCUBER

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.

simonlindholm avatar Sep 19 '25 23:09 simonlindholm