Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit20c35e8

Browse files
committed
#180-Implement CppStringT::operator* ()
Completed. Still to be tested.
1 parentfbde103 commit20c35e8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎cpp-strings/cppstrings.h‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,20 @@ namespace pcs // i.e. "pythonic c++ strings"
12471247
}
12481248

12491249

1250+
//--- operator * --------------------------------------
1251+
/** Generates a new string with count times the content of this string.*/
1252+
CppStringToperator* (std::int64_t count)constnoexcept
1253+
{
1254+
if (count <=0)
1255+
returnCppStringT();
1256+
1257+
CppStringTres( *this );
1258+
while (--count)
1259+
res += *this;
1260+
return res;
1261+
}
1262+
1263+
12501264
//--- partition() -------------------------------------
12511265
/** Splits the string at the first occurrence of sep, and returns a 3-items vector containing the part before the separator, the separator itself, and the part after the separator.
12521266
*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp