Why is the btree's size_type signed? #993
Replies: 1 comment 3 replies
-
https://google.github.io/styleguide/cppguide.html#Integer_Types
At the C++ Standards level roughly 2/3 of committee members agree that
unsigned-sizes was a mistake, but the C++ standard is too brittle to ever
change that. Non-standard types are faced with "Follow the pattern that we
believe is wrong" or "Do a higher-friction thing that is a better long-term
outcome."
(Neither answer is great.)
…On Fri, Jul 30, 2021 at 5:20 PM bobaoCrbs ***@***.***> wrote:
Hi,
I am just wondering why the size() of btree containers is of type "signed
size_t". (instead of just size_t?).
i.e. this line
<https://github.com/abseil/abseil-cpp/blob/5de90e2673bd0c19de67c68e2fe543444dc1114a/absl/container/internal/btree.h#L241>
Thanks
Bo
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#993>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC7CRX5DXF36TQDFPIXMC53T2MJRZANCNFSM5BJHS4HA>
.
--
*If you get an email from me outside of the 9-5 it is *not* because I'm
always on or expect an immediate response from you; it is because of work
flexibility
<http://www.inc.com/john-boitnott/how-flexible-hours-can-create-a-better-work-life-balance.html>
. Evening and weekend emails are a sign I allocated some regular working
hours for other things (such as family, gym, friends,...). And I encourage
you to feel free to do the same.
|
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
bobaoCrbs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am just wondering why the size() of btree containers is of type "signed size_t". (instead of just size_t?).
i.e. this line
Thanks
Bo
Beta Was this translation helpful? Give feedback.
All reactions