I've a question on passing by reference into the constructor.
I have the following constructor, say:
1 2 3
|
aClass example(complexClass &c1, complexClass &c2, int whatever);
|
so, i'm passing in two complex classes. My question is, what is the best way to store these as member variables? I'm interested mainly in speed, and so when i access aClass, I want it to be as optimal as possible.
Previously, i was passing in my complex classes by pointer:
|
aClass example(complexClass *c1, complexClass *c2, int whatever);
|
and then storing the member variables as pointers also.
But how should i store the member variables when passing by reference?
Hope that makes sense. I assume there's probably no one answer that fits all, but any advice is always appreciated.