Mar. 2nd, 2015

chris_archer: (Default)

include

std::string operator*(std::string& s, unsigned int n)
{
std::string cml;

cml.reserve(s.size() * n);

for (decltype(n) i = 0; i < n; i++) { cml += s; } return cml; } int main() { std::string s = "test"; std::string sss = s*3; std::cout << sss << std::endl; }

Originally published at Chase Your Dreams!. You can comment here or there.

Profile

chris_archer: (Default)
chris_archer

September 2017

S M T W T F S
     12
34 56789
10 111213141516
17181920212223
24252627282930

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Oct. 22nd, 2017 01:03 am
Powered by Dreamwidth Studios