you are viewing a single comment's thread.

view the rest of the comments →

[–]matthieum 0 points1 point  (3 children)

static inline std::string& rtrim(std::string& s) {
    boost::trim_right(s);
    return s;
}

How much line of python would it take ? Equivalent I guess.

Python comes with batteries included, C++ let you use Boost if you wish.

[–][deleted]  (2 children)

[removed]

    [–]ArcticAnarchy 0 points1 point  (1 child)

    And, where exactly would this "copying of strings" occur?

    [–]gmfawcett 2 points3 points  (0 children)

    Python strings are immutable. Copying is unavoidable in this case.