In C++, every member function belongs to a single class. When you discover a function, you need to know the class of which it will become a member function. The best choice is, of course, to add the function to a class that has a sense of responsibility and competence for the particular function.