35 #ifndef Foam_SubStrings_H 36 #define Foam_SubStrings_H 61 static std::string_view
view(
const std::ssub_match& m)
63 if (!m.matched)
return std::string_view();
65 #if __cplusplus >= 202002L 66 return std::string_view(m.first, m.second);
69 return std::string_view
71 std::pointer_traits<const char*>::pointer_to(*(m.first)),
86 for (
const auto& elem : *
this)
97 return (*
this)[
pos].length();
101 std::string
str(
size_t pos)
const 103 return (*
this)[
pos].str();
107 std::string_view
view(
size_t pos)
const 115 std::string::const_iterator
b,
116 std::string::const_iterator
e 119 auto&
range = this->emplace_back();
122 range.matched =
true;
128 if (
n >= this->size())
142 if (
n >= this->size())
149 for (
size_t src =
n, dst = 0; src < this->size(); ++src, ++dst)
151 (*this)[dst] = (*this)[src];
153 this->
resize(this->size() -
n);
patchWriters resize(patchIds.size())
void pop_back(size_t n=1)
Reduce size by 1 or more elements. Can be called on an empty list.
std::string str(size_t pos) const
Retrieve element at pos, as a string.
std::string::size_type length() const
The total string length of all sub-elements.
Sub-ranges of a string with a structure similar to std::match_results, but without the underlying reg...
dimensionedScalar pos(const dimensionedScalar &ds)
const dimensionedScalar e
Elementary charge.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
std::string::size_type length(size_t pos) const
Return length of element at pos.
graph_traits< Graph >::vertices_size_type size_type
void append(std::string::const_iterator b, std::string::const_iterator e)
Append sub-string defined by begin/end iterators.
static std::string_view view(const std::ssub_match &m)
Return match as a string_view.
void pop_front(size_t n=1)
Reduce size by 1 or more elements (from the front). Can be called on an empty list.