I would like to point out that the free function to_lower requires you to type one character less than the member function string::to_lower (or generally any free function vs member function), namely the dot character.
Originally Posted by Elysia
Now, if an API provided a key_exists function for containers with find member, exactly how does the following not abstract the algorithm away for the user less than a member function of set, map etc. would?
template <class Container, class Type>
bool key_exists(const Container& c, const Type& t)
return c.find(t) != c.end();
Yeah, in Western society the word "free" has clearly negative connotations. Anybody should see immediately that free things are bad.
Free functions are simple "worse" (if you could call it that), because it's exactly that - free. It's not a member function.