News for hackers. Stuff that matters.
Re:In C++, is empty() faster than comparing the size with zero? by kllrnohj on Saturday October 30, 2021 @02:58PM (#29051375)
It's a tradeoff the user can make, not something the STL needs to generically know like std::string does. If you look at inlined_vector (or similar implementations), the static size is specified in a type parameter, not something automatic. So just have it be 0 if you want it to behave like std::vector does currently. As such, no downsides to adding this to the type other than the ABI breakage. Default the size to 0 and you preserve API compatibility, even.

There are no comments on this comment yet.