statically known interned strings these have O(1) comparison for equality More...
#include <static_string.hpp>
Public Types | |
using | traits_type = Traits |
using | value_type = CharT |
using | pointer = CharT * |
using | const_pointer = CharT const * |
using | reference = CharT & |
using | const_reference = CharT const & |
using | const_iterator = CharT const * |
using | iterator = const_iterator |
using | const_reverse_iterator = std::reverse_iterator<const_iterator> |
using | reverse_iterator = const_reverse_iterator |
using | size_type = std::size_t |
using | difference_type = std::ptrdiff_t |
Public Member Functions | |
constexpr | basic_static_string (std::basic_string_view< CharT, Traits > view) |
constructors | |
template<CharT... xs> | |
consteval | basic_static_string (std::integer_sequence< CharT, xs... >) |
constexpr | basic_static_string () noexcept=default |
constexpr | basic_static_string (basic_static_string const &) noexcept=default |
constexpr | basic_static_string (basic_static_string const &&) noexcept=default |
assignments | |
ein_reinitializes constexpr basic_static_string & | operator= (basic_static_string const &that) noexcept=default |
ein_reinitializes constexpr basic_static_string & | operator= (basic_static_string &&that) noexcept=default |
conversions | |
constexpr | operator CharT const * () const noexcept |
constexpr | operator std::basic_string_view< CharT, Traits > () const noexcept |
constexpr | operator std::basic_string< CharT, Traits > () const noexcept |
element access | |
constexpr CharT const & | operator[] (size_type i) const noexcept |
access the specified character | |
constexpr CharT const & | at (size_type i) const |
access the specified character with bounds checking | |
constexpr const_reference | front () const noexcept |
Returns reference to the first character in the static_string. | |
constexpr const_reference | back () const noexcept |
constexpr const_pointer | data () const noexcept |
capacity | |
constexpr size_type | size () const noexcept |
constexpr size_type | length () const noexcept |
constexpr size_type | max_size () const noexcept |
constexpr bool | empty () const noexcept |
operator bool () const noexcept | |
iterators | |
constexpr auto | begin () const noexcept |
constexpr auto | end () const noexcept |
constexpr auto | cbegin () const noexcept |
constexpr auto | cend () const noexcept |
constexpr auto | rbegin () const noexcept |
constexpr auto | rend () const noexcept |
constexpr auto | crbegin () const noexcept |
constexpr auto | crend () const noexcept |
Static Public Attributes | |
static constexpr size_type | npos = std::basic_string_view<CharT,Traits>::npos |
Private Attributes | |
std::basic_string_view< CharT, Traits > | view |
Friends | |
class | static_c_string |
constexpr friend void | swap (basic_static_string &x, basic_static_string &y) noexcept |
comparisons | |
| |
constexpr bool | operator== (basic_static_string self, basic_static_string that) noexcept |
constexpr bool | operator!= (basic_static_string self, basic_static_string that) noexcept |
constexpr basic_ostream< CharT, Traits > & | operator<< (basic_ostream< CharT, Traits > &os, basic_static_string< CharT, Traits > v) |
input/output | |
statically known interned strings these have O(1) comparison for equality
len
is unmodified. this ensures that they have O(1) comparison, because reference and pointer equality coincide. Definition at line 40 of file static_string.hpp.
using ein::basic_static_string< CharT, Traits >::const_iterator = CharT const * |
Definition at line 55 of file static_string.hpp.
using ein::basic_static_string< CharT, Traits >::const_pointer = CharT const * |
Definition at line 52 of file static_string.hpp.
using ein::basic_static_string< CharT, Traits >::const_reference = CharT const & |
Definition at line 54 of file static_string.hpp.
using ein::basic_static_string< CharT, Traits >::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Definition at line 57 of file static_string.hpp.
using ein::basic_static_string< CharT, Traits >::difference_type = std::ptrdiff_t |
Definition at line 60 of file static_string.hpp.
using ein::basic_static_string< CharT, Traits >::iterator = const_iterator |
Definition at line 56 of file static_string.hpp.
using ein::basic_static_string< CharT, Traits >::pointer = CharT * |
Definition at line 51 of file static_string.hpp.
using ein::basic_static_string< CharT, Traits >::reference = CharT & |
Definition at line 53 of file static_string.hpp.
using ein::basic_static_string< CharT, Traits >::reverse_iterator = const_reverse_iterator |
Definition at line 58 of file static_string.hpp.
using ein::basic_static_string< CharT, Traits >::size_type = std::size_t |
Definition at line 59 of file static_string.hpp.
using ein::basic_static_string< CharT, Traits >::traits_type = Traits |
Definition at line 49 of file static_string.hpp.
using ein::basic_static_string< CharT, Traits >::value_type = CharT |
Definition at line 50 of file static_string.hpp.
|
inlineconstexpr[[always_inline]] |
Definition at line 45 of file static_string.hpp.
|
inlineexplicitconsteval |
Definition at line 66 of file static_string.hpp.
|
constexprdefaultnoexcept[[always_inline]] |
|
constexprdefaultnoexcept[[always_inline]] |
|
constexprdefaultnoexcept[[always_inline]] |
|
inlineconstexpr[[nodiscard]][[always_inline]][[pure]] |
access the specified character with bounds checking
Definition at line 118 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
Definition at line 135 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[const]][[artificial]] |
Definition at line 198 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[const]][[artificial]] |
Definition at line 204 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
Definition at line 207 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
Definition at line 216 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
Definition at line 219 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
Definition at line 138 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
Referenced by ein::basic_static_string< char >::operator char const *().
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
Definition at line 154 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
Definition at line 201 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
Returns reference to the first character in the static_string.
empty()
, this offers the slight weakening that it'll return CharT(0)
.Definition at line 131 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
Definition at line 148 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
Definition at line 151 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
inlineexplicitnoexcept[[nodiscard]][[always_inline]][[pure]] |
Definition at line 157 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
Definition at line 94 of file static_string.hpp.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
Definition at line 104 of file static_string.hpp.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
Definition at line 99 of file static_string.hpp.
|
constexprdefaultnoexcept[[always_inline]] |
|
constexprdefaultnoexcept[[always_inline]] |
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
access the specified character
Definition at line 114 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
Definition at line 210 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
Definition at line 213 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
inlineconstexprnoexcept[[nodiscard]][[always_inline]][[pure]] |
Definition at line 145 of file static_string.hpp.
References ein::basic_static_string< CharT, Traits >::view.
|
friend[[nodiscard]][[always_inline]][[pure]][[artificial]] |
Traits::eq
is assumed reflexive Definition at line 174 of file static_string.hpp.
|
friend |
input/output
std::ios_base:failure | if an exception is thrown during output. |
Definition at line 187 of file static_string.hpp.
|
friend[[nodiscard]][[always_inline]][[pure]][[artificial]] |
Definition at line 164 of file static_string.hpp.
|
friend |
Definition at line 48 of file static_string.hpp.
|
friend[[always_inline]] |
Definition at line 224 of file static_string.hpp.
|
staticconstexpr |
Definition at line 229 of file static_string.hpp.
|
private |
Definition at line 41 of file static_string.hpp.
Referenced by ein::basic_static_string< CharT, Traits >::at(), ein::basic_static_string< CharT, Traits >::back(), ein::basic_static_string< CharT, Traits >::begin(), ein::basic_static_string< CharT, Traits >::cbegin(), ein::basic_static_string< CharT, Traits >::cend(), ein::basic_static_string< CharT, Traits >::crbegin(), ein::basic_static_string< CharT, Traits >::crend(), ein::basic_static_string< CharT, Traits >::data(), ein::basic_static_string< CharT, Traits >::empty(), ein::basic_static_string< CharT, Traits >::end(), ein::basic_static_string< CharT, Traits >::front(), ein::basic_static_string< CharT, Traits >::length(), ein::basic_static_string< CharT, Traits >::max_size(), ein::basic_static_string< CharT, Traits >::operator bool(), ein::basic_static_string< char >::operator char const *(), ein::basic_static_string< char >::operator std::basic_string< char, std::char_traits< char > >(), ein::basic_static_string< char >::operator std::basic_string_view< char, std::char_traits< char > >(), ein::basic_static_string< CharT, Traits >::operator[](), ein::basic_static_string< CharT, Traits >::rbegin(), ein::basic_static_string< CharT, Traits >::rend(), and ein::basic_static_string< CharT, Traits >::size().