mirror of
https://github.com/boostorg/static_string.git
synced 2025-07-29 20:17:35 +02:00
Update readme and remove unneeded includes
This commit is contained in:
14
README.md
14
README.md
@ -26,7 +26,7 @@ A fixed capacity string is useful when:
|
|||||||
segment is required.
|
segment is required.
|
||||||
* A dynamically-resizable string is required within `constexpr` functions.
|
* A dynamically-resizable string is required within `constexpr` functions.
|
||||||
* The storage location of the static_vector elements is required to be
|
* The storage location of the static_vector elements is required to be
|
||||||
within the string object itself (e.g. to support memcopy for serialization
|
within the string object itself (e.g. to support `memcpy` for serialization
|
||||||
purposes).
|
purposes).
|
||||||
|
|
||||||
## Design
|
## Design
|
||||||
@ -35,7 +35,17 @@ The over-arching design goal is to resemble the interface and behavior of
|
|||||||
`std::string` as much as possible. When any operation would exceed the
|
`std::string` as much as possible. When any operation would exceed the
|
||||||
maximum allowed size of the string, `std::length_error` is thrown. All
|
maximum allowed size of the string, `std::length_error` is thrown. All
|
||||||
algorithms which throw exceptions provide the strong exception safety
|
algorithms which throw exceptions provide the strong exception safety
|
||||||
guarantee.
|
guarantee. This is intended to be a drop in replacement for `std::string`.
|
||||||
|
All the operations for `fixed_string` work when the source is within the string itself.
|
||||||
|
|
||||||
|
The API of `fixed_string` only diverges from `std::string` in few places,
|
||||||
|
being `substr` for which this implementation returns a string view instead of `fixed_string,
|
||||||
|
and certain functions that will never throw are marked as `noexcept`, which diverges from
|
||||||
|
those of `std::string`. Every function that is in the C++20 specification of `std::string` is
|
||||||
|
present in this implementation, with the only difference being the lack of `constexpr`
|
||||||
|
for the time being. The avaliable overloads for `fixed_string` are identical to those
|
||||||
|
of `std::string`, except for `operator+` which is explicitly deleted as no reasonable implementation
|
||||||
|
would be possible, due to the difficulty in determining the size of the resulting `fixed_string`.
|
||||||
|
|
||||||
## Iterators
|
## Iterators
|
||||||
|
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <stdexcept>
|
|
||||||
#include <string>
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
|
Reference in New Issue
Block a user