samedi 23 avril 2016

Is there any advantage to implementing functions as free functions rather than members in C++?

I'm interested in the technical logistics. Is there any advantage, such as memory saved, etc., to implementing certain functions dealing with a class?

In particular, implementing operator overloads as free functions (providing you don't need access to any private members, and even then you can make them use a friend non-member)?

Is a distinct memory address provided for each function of the class each time an object is created?

Aucun commentaire:

Enregistrer un commentaire