(for simplicity I will only mention the getLength() function/method)
Note that some of my points refer to the advantages of global functions in general. I think we agree that not
all the advantages can be applied
always. So, claiming that some of my arguments don't apply to sf::Vector2 in particular doesn't render them less good reasons to use member functions in other situations.
I did not find a single argument. Only "Vector2<int> would be a problem".
You didn't search enough. For example, consider
this thread.
Just do not pollute the sf namespace with specific functions for this and that.
I don't see in how far this is a problem of practical relevance. It's not the global namespace, and there is no danger of name collisions.
Classes are not only for combining variables into a single one.
I didn't say member functions should be avoided. I wanted to show that, in some cases, global functions are the better choice. However, sf::Vector2<T> is a particular example, since it only has two public member variables and some constructors. All the vector operators are global as well.
They can be overloaded for different object types. Several classes can have a same-looking method as well
I expected that to come. However, this brings two restrictions: You must use classes (no other types are possible), and the classes must have a consistent interface, which is hard to achieve when dealing with different libraries (i.e. impossible without modifying library code). Global functions can work as adapters.
They take implicit object conversions into account. I do not want anything to be converted into a vector implicitly
Maybe you don't. Others do. I even have a good example of an own class PolarVector2<T> which stores polar instead of cartesian coordinates. To work seamlessly with SFML, an implicit conversion may be desired:
PolarVector2<float> v;
sf::GetLength(v); // possible
v.GetLength(); // not possible
They increase encapsulation since they don't have direct access to all class members. Vector2 has only public members, is not even close to an argument btw
Again, this is meant in general. And I don't think it's completely wrong if
Scott Meyers propagates it.
They can interact with argument dependent lookup. Methods behave similarly
Wrong, they do not. Do you know ADL? It's a namespace-related feature which can obviously not apply to member functions. The ability to abstract from types becomes less powerful if the types are restricted to classes. Consider the following code. You cannot achieve those semantics with member functions.
swap(a, b); // calls the correct function independent of
// the type and namespace of a and b
They can be declared separate from the class definition. Why should someone want that? Would be confusing to have vector functions in a different header than the vector itself
Because the header might be not accessible? What if I plan to expand the interface with a GetSquaredLength() function? It wouldn't be possible as a member without modifying SFML's code. For a global function, in contrast, this task becomes really easy.
If you want to use globals a lot, I would recommend C.
Please be serious. I hope you see the difference between global functions and global variables. I don't know in how far your C++ becomes more idiomatic, modern or just "better" only because you use member functions instead of global ones without thinking about the implications. Remember: OOP doesn't mean to put everything into classes.