string_view icon indicating copy to clipboard operation
string_view copied to clipboard

substr() throws if pos == size

Open AdmiralCurtiss opened this issue 6 years ago • 1 comments

For example:

    string_view x("abc");
    string_view y = x.substr(3);
    ASSERT_TRUE(y == "");

I would expect an empty string to be returned. Compare https://en.cppreference.com/w/cpp/string/basic_string_view/substr

Note: See also https://github.com/bitwizeshift/string_view-standalone/issues/3, same issue there.

AdmiralCurtiss avatar Jul 04 '19 17:07 AdmiralCurtiss

Thank you for report.

satoren avatar Jul 07 '19 01:07 satoren