Closed BenHetherington closed 5 years ago
Tests?
Whoops, looks like I saw the tests/
directory, but missed the string/tests/
directory, so I naïvely assumed there weren't any existing tests for split
and co. I'll push some new lvalue tests now.
Now that tests have been added, is there anything else you'd like me to do to advance this PR, @mclow?
Sorry to bump this again, but it'd be really nice if this usability improvement could be merged at some point 🙂 If there's anything you'd like me to do to aid that, e.g. seeing where else this change could be helpful in boost::algorithm
, or rebasing/squashing commits, then I'd be very happy to do so!
Just saw this tonight. I'll see if I can get to it this weekend.
On compilers that support C++11, this allows both lvalues and rvalues to be used as inputs to the
split()
,find_all()
, andifind_all()
functions.For example, given a function
get_string()
that returns astd::string
, this allows you to write:I'm somewhat surprised that this hasn't been done before, so if I'm missing something, then do let me know. I've hardly done a comprehensive investigation on where else these changes could be made in
boost::algorithm
, so I'm also happy to expand this PR if necessary.