Implement std::size and std::ssize for C-style arrays#57
Implement std::size and std::ssize for C-style arrays#57davidtranhq wants to merge 2 commits intomanagarm:masterfrom
Conversation
|
LGTM, anyone else have objections to merging this? Alternatively it could live in cxxshim? |
Dennisbonke
left a comment
There was a problem hiding this comment.
Two style nitpicks, other than that this looks good to me.
no92
left a comment
There was a problem hiding this comment.
I'd prefer the second commit to be squashed into the first, other than that LGTM.
|
Don't hijack std:: in frigg |
i.e this could be changed to use the |
yeah, not sure what's preferred here. I wanted it to match the corresponding |
|
Either way, frigg should not clash with the standard, and more conservatively, the standard namespace. I recommend the GCC 13 route if you can afford using a compiler with potential regressions (and, again, finding and reporting such regressions is invaluable). |
|
oh, also, FTR: adding stuff to |
C++17 and C++20 defines template functions for deducing the size of C-style arrays. I've found this useful and the implementation is simple (pretty much identical to the implementation on cppreference).