Beispiel #1
0
 str operator+(str const &self, char const(&other)[N])
 {
   std::string s;
   s.reserve(self.size() + N);
   s += self.get_data();
   s += other;
   return {std::move(s)};
 }
Beispiel #2
0
 str operator+(char const(&self)[N], str const &other)
 {
   std::string s;
   s.reserve(other.size() + N);
   s += self;
   s += other.get_data();
   return {std::move(s)};
 }
Beispiel #3
0
 str operator+(str const &self, str const &other)
 {
   return str(self.get_data() + other.get_data());
 }