A question on passing by reference and member variables

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.
I am not sure if I understand you well, but here is my suggestion to what I get.

In case of passing by reference, the constructor's implementation would be just like this:

1
2
3
4
{
    someMember1 = c1;
    someMember2 = c2;
}


And in case of pointers:

1
2
3
4
{
    someMember1 = *c1;
    someMember2 = *c2;
}


I hope I didn't misunderstand you here.
Well to start you gave your constructor a return value and a name...
Topic archived. No new replies allowed.