gul-cpp / gul14

General Utility Library for C++14
https://gul14.info/
GNU Lesser General Public License v2.1
2 stars 1 forks source link

join(): Document that string type must provide size() #94

Closed alt-graph closed 2 days ago

alt-graph commented 2 months ago

We documented that the string type must provide an operator+=(string&, T), but forgot that it must also provide a size() member. This PR adds that documentation.

soerengrunewald commented 2 months ago

:+1:

Both string and string_view should meet the requirement. And const char* is convertible, so how did you notice this requirement?

alt-graph commented 2 months ago

👍

Both string and string_view should meet the requirement. And const char* is convertible, so how did you notice this requirement?

In Taskolib we have a Tag class that is basically a string, but did not provide size(). And we wanted to turn a vector<Tag> into a string with gul14::join(tags, " ")...