mirror of
https://github.com/boostorg/static_string.git
synced 2026-01-19 16:52:11 +00:00
This introduces an alternative to basic_static_string designed for use in POD types: Trivially copyable, having a sizeof == N + 1, with no embedded NULs. Placed in example/ to gather user feedback before committing to a public API. See issue #23.
13 lines
888 B
Markdown
13 lines
888 B
Markdown
This directory contains an experimental implementation of `basic_static_cstring`, which differs from `basic_static_string` in the following ways:
|
|
|
|
| | `basic_static_cstring` | `basic_static_string` |
|
|
|---------------------|------------------------|-----------------------|
|
|
| Layout | `sizeof == N + 1` | Has size member |
|
|
| Embedded NULs | Not supported | Supported |
|
|
| Trivially copyable | Yes | No |
|
|
|
|
Additionally, when `N <= UCHAR_MAX`, `basic_static_cstring` employs an optimization that avoids calling `std::strlen()` to compute the size.
|
|
|
|
This work stems from [boostorg/static_string#23](https://github.com/boostorg/static_string/issues/23).
|
|
|
|
If you believe `basic_static_cstring` should become part of the public API, please share your feedback on the Boost mailing list. |