@@ -146,6 +146,11 @@ namespace pcs // i.e. "pythonic c++ strings"
146146 inline CppStringT (const CharT* s, size_type count) : MyBaseClass(s, count) {}
147147 inline CppStringT (std::initializer_list<CharT> ilist) : MyBaseClass(ilist) {}
148148
149+ inline CppStringT (const MyBaseClass& other) : MyBaseClass(other) {}
150+ inline CppStringT (const MyBaseClass& other, const AllocatorT& alloc) : MyBaseClass(other, alloc) {}
151+ inline CppStringT (MyBaseClass&& other) : MyBaseClass(other) {}
152+ inline CppStringT (MyBaseClass&& other, const AllocatorT& alloc) : MyBaseClass(other, alloc) {}
153+
149154 template <class InputIt >
150155 inline CppStringT (InputIt first, InputIt last) : MyBaseClass(first, last) {}
151156
@@ -1334,6 +1339,17 @@ namespace pcs // i.e. "pythonic c++ strings"
13341339 }
13351340
13361341
1342+ // --- substr() ----------------------------------------
1343+ /* * \brief Returns acopy of the string, starting at index start and ending after count characters. */
1344+ inline CppStringT substr (const size_type start, const size_type count) const noexcept
1345+ {
1346+ if (start > this ->size ())
1347+ return *this ;
1348+ const size_type width = std::min (count, this ->size () - start);
1349+ return CppStringT (MyBaseClass::substr (start, width));
1350+ }
1351+
1352+
13371353 // --- swapcase() --------------------------------------
13381354 /* * \brief Returns a copy of the string with uppercase characters converted to lowercase and vice versa.
13391355 *
0 commit comments