45template <
size_t capacity_>
90 static_assert(N <= capacity_ + 1,
"Length of string literal exceeds capacity of small_string.");
111 static_assert(N <= capacity_ + 1,
"Length of string literal exceeds capacity of small_string.");
131 constexpr void assign(
char const (&_lit)[N])
noexcept
133 static_assert(N <= capacity_ + 1,
"Length of string literal exceeds capacity of small_string.");
134 assert(_lit[N - 1] ==
'\0');
135 assign(&_lit[0], &_lit[N - 1]);
153 template <std::forward_iterator begin_it_type,
typename end_it_type>
154 requires(std::sentinel_for<end_it_type, begin_it_type> &&
155 std::constructible_from<value_type, std::iter_reference_t<begin_it_type>>)
156 constexpr void assign(begin_it_type begin_it, end_it_type end_it)
noexcept
163 constexpr void assign(
char const *
const begin_it,
char const *
const end_it)
noexcept
194 assert(sz < capacity_);
215 assert(count <= capacity_);
217 for (
size_t i = sz; i < count; ++i)
244 assert(index <= this->
size());
268 template <
size_t capacity2>
273 tmp.
insert(tmp.end(), rhs.begin(), rhs.end());
322 constexpr char const *
c_str() const noexcept {
return data_.data(); }
340 template <
size_t cap2>
347 template <
size_t cap2>
402template <std::same_as<
char>... t>
403 requires(
sizeof...(t) > 0)
409#if __has_include(<fmt/format.h>)
411# include <fmt/ranges.h>
425template <
size_t capacity>
426 requires(capacity <= 30)
Implements a small string that can be used for compile time computations.
Definition: small_string.hpp:47
friend constexpr auto operator<=>(small_string const &lhs, small_string< cap2 > const &rhs) noexcept
Performs element-wise comparison.
Definition: small_string.hpp:348
constexpr void clear() noexcept
Removes all elements from the container.
Definition: small_string.hpp:185
constexpr void pop_back() noexcept
Removes the last element of the container.
Definition: small_string.hpp:201
constexpr small_string & operator=(char const (&_lit)[N]) noexcept
Assign from literal.
Definition: small_string.hpp:109
constexpr small_string & erase(size_type index=0, size_type count=max_size()) noexcept
Removes specified elements from the container.
Definition: small_string.hpp:242
constexpr void resize(size_type const count) noexcept
Resizes the container to contain count elements.
Definition: small_string.hpp:209
constexpr friend small_string< capacity_+capacity2 > operator+(small_string const &lhs, small_string< capacity2 > const &rhs) noexcept
Concatenates two small_strings by returning a new small_string.
Definition: small_string.hpp:269
friend constexpr auto operator<=>(small_string const &lhs, std::string_view const &rhs) noexcept
Performs element-wise comparison.
Definition: small_string.hpp:360
constexpr std::string_view view() const
Returns the content represented as std::string_view.
Definition: small_string.hpp:308
static constexpr size_type max_size() noexcept
Returns the maximal size which equals the capacity.
Definition: small_string.hpp:175
constexpr void resize(size_type const count, char const value) noexcept
Resizes the container to contain count elements.
Definition: small_string.hpp:213
friend constexpr bool operator==(small_string const &lhs, small_string< cap2 > const &rhs) noexcept
Performs element-wise comparison.
Definition: small_string.hpp:341
friend constexpr bool operator==(small_string const &lhs, std::string_view const &rhs) noexcept
Performs element-wise comparison.
Definition: small_string.hpp:354
constexpr void push_back(char const value) noexcept
Appends the given element value to the end of the container.
Definition: small_string.hpp:192
std::string str() const
Returns the content represented as std::string.
Definition: small_string.hpp:294
small_string(char const(&)[N]) -> small_string< N - 1 >
Deduces small_string from string literals.
constexpr small_string(char const (&_lit)[N]) noexcept
Construction from literal.
Definition: small_string.hpp:88
constexpr void assign(begin_it_type begin_it, end_it_type end_it) noexcept
Assign from pair of iterators.
Definition: small_string.hpp:156
constexpr char const * c_str() const noexcept
Returns the content represented as 0-terminated c-style string.
Definition: small_string.hpp:322
small_string(std::array< char, N > const &) -> small_string< N >
Deduces small_string from std::array of type char.
constexpr void assign(char const (&_lit)[N]) noexcept
Assign from literal.
Definition: small_string.hpp:131
static constexpr size_type capacity() noexcept
Returns the maximal capacity.
Definition: small_string.hpp:178
friend std::ostream & operator<<(std::ostream &os, small_string const &str)
Formatted output for the bio::ranges::small_string.
Definition: small_string.hpp:379
A constexpr vector implementation with dynamic size at compile time.
Definition: small_vector.hpp:45
constexpr const_iterator cend() const noexcept
Returns iterator past the end of the vector.
Definition: small_vector.hpp:313
value_type & reference
The reference type.
Definition: small_vector.hpp:55
char value_type
The value_type type.
Definition: small_vector.hpp:54
constexpr void assign(std::initializer_list< value_type > ilist) noexcept(is_noexcept)
Assign from std::initializer_list.
Definition: small_vector.hpp:225
constexpr value_type * data() noexcept
Direct access to the underlying array.
Definition: small_vector.hpp:434
constexpr iterator insert(const_iterator pos, value_type const value) noexcept(is_noexcept)
Inserts value before position in the container.
Definition: small_vector.hpp:541
meta::detail::min_viable_uint_t< capacity_ > size_type
The size_type type.
Definition: small_vector.hpp:60
ptrdiff_t difference_type
The difference_type type.
Definition: small_vector.hpp:59
constexpr const_iterator cbegin() const noexcept
Returns the begin iterator of the vector.
Definition: small_vector.hpp:304
value_type const * const_iterator
The const_iterator type.
Definition: small_vector.hpp:58
value_type const & const_reference
The const_reference type.
Definition: small_vector.hpp:56
constexpr size_type size() const noexcept
Returns the number of elements in the container, i.e. std::distance(begin(), end()).
Definition: small_vector.hpp:467
constexpr iterator erase(const_iterator begin_it, const_iterator end_it) noexcept
Removes specified elements from the container.
Definition: small_vector.hpp:647
constexpr iterator begin() noexcept
Returns the begin iterator of the vector.
Definition: small_vector.hpp:298
value_type * iterator
The iterator type.
Definition: small_vector.hpp:57
The ranges module's namespace.
The main BioC++ namespace.
Definition: aa10li.hpp:23
A constexpr vector implementation with dynamic size at compile time.