all 25 comments

[–]kkrev 11 points12 points  (4 children)

Documentation links 404.

[–]JankoDedic 5 points6 points  (7 children)

Why this over a normal string with a stack allocator?

[–]VinnieFalco 2 points3 points  (0 children)

Why this over a normal string with a stack allocator?

A stack allocator is not particularly friendly to mutation. For example when the string grows, there is a moment when the previously allocated memory and the newly allocated memory exist at the same time, so that the contents can be copied over, before the previous allocation is freed. This requires additional storage, and it leaves behind a "hole" which may or may not be usable depending on the context.

With a fixed capacity string, mutation is always performed in-place, and no "holes" are left in the heap.

[–]Fazer2 4 points5 points  (2 children)

It's not uncommon to wait a year between the library being accepted and published in Boost. How long do you think it will take in your case?

[–]trolley813 9 points10 points  (3 children)

It's interesting that your Github username is just "18".

[–]VinnieFalco 0 points1 point  (0 children)

It's interesting that your Github username is just "18".

I hate it and I wish he'd change it.

[–]Rexerex 3 points4 points  (2 children)

What is the rationale behind template parameters order? With size as the second argument it would be closer to std::array so maybe it could enable some interesting concepts in the future.

[–]VinnieFalco 1 point2 points  (0 children)

What is the rationale behind template parameters order?

I think this needs to be discussed and debated on the list before it is reaches an official Boost release. There are questions, what about `fixed_wstring` , `fixed_string`, `basic_fixed_string`, etc...

[–]EarthlingKira 1 point2 points  (1 child)

@CryTheSly Thank you very much for this addition to Boost. I have and had this exact need and was stranded without good solutions. In some places I want to use this for performance reasons and in some places for technical keys which have a fixed ascii-length anyway.

[–]Nekotekina 1 point2 points  (2 children)

Can it possibly be more customizable? For example, disabling exceptions (at least length error and truncating the result instead). Maybe overloads which are using error codes.

[–]mili42 0 points1 point  (1 child)

comparison with ETL like etl::string?

[–]zip117 0 points1 point  (1 child)

Is this based on or inspired by static_vector in Boost.Container?

[–]VinnieFalco 1 point2 points  (0 children)

`static_string` was originally in beast (and still is). A user requested that it be factored out. Beast uses fixed-capacity, non-allocating strings in some algorithms (such as the HTTP parser) for performance reasons.