"Per" <pe*********@gmail.com> wrote in message
news:f6**************************@posting.google.c om...
Hi!
Does it take longer time to initialize a class with many
member-functions
than one with fewer?
Will the sizeof (Some Class) return more bytes on a class with more
member-functions etc...
/p
No, it will not. This is all taken care of by the compiler - obviously
at compiletime. The size of your class should not increase.
Deciding whether a function should be a member is usually a design
decision and has nothing to do with optimisations.
Usually, unless there's a very good reason to make it a member
function [Example:
- you need to access private members that you can't otherwise
- you need to override a virtual function
- it can't be implemented using the current class' public interface
- it is an operator that requiers to be a member], you should probably
not make it a member. It is better to have as simple as possible (but
not simpler) interfaces to keep things clear.
Vladimir Ciobanu.