Yeah, I've learned this much.
I consider it a convenience. Something that makes it better if I have time to do it!That would save a lot of time not having to re-invent the wheel, even if it's just re-wrapping the wheel.
I mean, it adds extra time, so call it "free time stuff" - things you can do if you really have time or want to. It doesn't add anything to the project.
I see that as a problem with the documentation. Obviously they didn't document it good enough! You could run into the same problem if the free functions weren't documented either!I found a class at work with over 150 member functions & 120 member variables!!! Worse yet, there was absolutely no documentation about what any of it does... So trying to modify it is a nightmare. Don't make the same mistake as they made, otherwise the developer that has to inherit your code will curse your name until the end of time.
The thing is... if they documented it properly, then that class would be easier to use than free functions (or at least for me), although modifying it might be another matter...
I do sleep... But generally I do also have access to a computer where I go! It keeps me from getting boredBTW Elysia, don't you ever sleep? I see you posting 24 hours a day!
I don't think so.
Std::string is one of the most unhelpful string classes I've seen. Replace is fatefully misnamed.
Find_first_of, for example, is also inappropriate named. It should be named more similarly to find_any_first_of or the like since it finds any of the characters in the string, not the entire phrase.
The replace function is misleading into believing it can search and replace a given occurrence of a string with another. Further, it does not reallocate or move data (I think?), so if you replace "Alice" with "Jonathan" you're going to overwrite data.
The std::replace is also flawed in that it can only replace single characters with another given character (if I remember this correctly). Who needs that? When I replace, I replace strings.
And std::string doesn't even have a char constructor, only for char*, so you'd have to convert your char into a string to pass it to the constructor or additionally construct the string and use insert.
This may not be 100% correct, but I'm not an expert at this yet.