I am trying to get a feel for modern C++ idioms and best practices, and I wanted to ask if, when authoring a class, there was ever a time one should make a function a member function, instead of a free-function in the class's namespace, besides when you need runtime dispatch based on the type of the class.
I was thinking maybe it would be when you need access to private members of the class, but you could also make a free friend function and get the same effect but with the benefits of free functions, so I am not sure what is best in that case.
Is it ever justified to make a non-virtual function a member?