just a thought about "doing the compilers job"

R

.rhavin grobert

guess you have the following:

class X {
int fn1(); // -\ lets assume those fn's
int fn2(); // >- do something independent
int fn3(); // -/ from each other
}

class Y {
public:
X& X() {return m_x;};
private:
X m_x;
};

class Z {
public:
Y& Y() {return m_y;};
private:
Y m_y;
};

_______________________________

now when i do something like this:

Z z;
CallWhateverFunctionTakingThreeInts(z.y().x().fn1,z.y().x().fn2,z.y().x().fn3);

is it as effective as writing ...

Z z;
X& x = z.y().x();
CallWhateverFunctionTakingThreeInts(x.fn1,x.fn2,x.fn3);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top