simstr 1.2.4
Yet another strings library
 
Loading...
Searching...
No Matches
simstr::StrType Concept Reference

Base concept of string object. More...

#include <strexpr.h>

Concept definition

template<typename A, typename K>
concept simstr::StrType = requires(const A& a) {
{ a.is_empty() } -> std::same_as<bool>;
{ a.length() } -> std::convertible_to<size_t>;
{ a.symbols() } -> std::same_as<const K*>;
} && std::is_same_v<typename std::remove_cvref_t<A>::symb_type, K>
Base concept of string object.
Definition strexpr.h:197

Detailed Description

Base concept of string object.

Template Parameters
A- tested type
K- type of symbols

The library can use different types of string objects for different purposes. We consider a string object to be any object that supports methods:

  • is_empty(): Returns whether the string is empty.
  • length(): returns the length of a string without a null terminator.
  • symbols(): returns a pointer to a string of symbols.
  • typename symb_type: sets the character type of the string