1 #ifndef SIPLASPLAS_CONSTEXPR_STRINGVIEW_HPP 2 #define SIPLASPLAS_CONSTEXPR_STRINGVIEW_HPP 4 #include "arrayview.hpp" 30 constexpr StringView(
char*
const str) :
34 StringView(std::string& str) :
38 std::string str()
const 47 if((*
this)[size() - 1] ==
'\0')
49 return { begin(), end() - 1};
53 return { begin(), end() };
57 constexpr
const char* c_str()
const 76 constexpr ConstStringView(
const char* str) :
80 ConstStringView(
const std::string& str) :
84 std::string str()
const 93 if((*
this)[size() - 1] ==
'\0')
103 constexpr
const char* c_str()
const 116 #endif // SIPLASPLAS_CONSTEXPR_STRINGVIEW_HPP Definition: arrayview.hpp:87
Definition: messaging.hpp:8
constexpr auto end(const Sequence &sequence)
Returns an iterator pointing to the end of a sequence.
Definition: algorithm.hpp:86
Implements a constexpr reference to an slice of an string.
Definition: stringview.hpp:17
constexpr auto begin(const Sequence &sequence)
Returns an iterator pointing to the beginning of a sequence.
Definition: algorithm.hpp:62
Definition: stringview.hpp:63
Definition: arrayview.hpp:15