|
Boost : |
From: degski (degski_at_[hidden])
Date: 2020-03-03 13:49:06
On Tue, 3 Mar 2020 at 02:16, Richard Hodges via Boost <boost_at_[hidden]>
wrote:
> Re: signedness of an implementation detail:
>
> (It seems to be that nature of c++ that minor details catalyse the most
> momentous arguments)
>
> It seems to me that:
>
> * degski has a point that there may be some conceptual efficiency gain by
> removing the unsigned restriction
>
> * this would necessarily mean that the overall size of the static_stringâs
> memory footprint becomes implementation defined (since the inplementor may
> now choose either a signed 16 bit word to represent the length of a string
> with capacity 128 rather than an 8 bit word.
>
I rather not write this, as we have already discussed this to death by
now, but the above should well be perfectly fine. std::string's don't have
the same foot-print in various implementations (possibly different between
debug and release) either, SSO is different ,VC 15 bytes, Clang 23 bytes.
One could argue I guess, that for a static string a fixed footprint is more
important, though, which is what you wrote further down.
I don't care that much, as long as it is flawless. A bonus to me would be
for it to be able to work with a lib like frozen, it has a static string,
but it is rudimentary, just enough to use them with compile-time maps, but
I have used those string already in the past (separately from the
frozen::map), so I guess I have a need for this Boost library. And,
finally, great, it is called static string now, I'm happy with that.
> My recommendation (for what itâs worth) is to ship as is ...
+1
degski
-- @systemdeg "We value your privacy, click here!" Sod off! - degski "Anyone who believes that exponential growth can go on forever in a finite world is either a madman or an economist" - Kenneth E. Boulding "Growth for the sake of growth is the ideology of the cancer cell" - Edward P. Abbey
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk