M
mailforpr
Hello.
Given is the following class:
class Test
{
public:
int i;
int& get() { return i; }
};
Now, is the following member access
Test test;
test.i; // this here
equivalent to this method call?:
Test test;
test.get();
Do I have to worry about what is faster? If they are not equal, do
compiler optimize to get rid of this difference in accessing the
member(s)?
Thanks in advance.
Given is the following class:
class Test
{
public:
int i;
int& get() { return i; }
};
Now, is the following member access
Test test;
test.i; // this here
equivalent to this method call?:
Test test;
test.get();
Do I have to worry about what is faster? If they are not equal, do
compiler optimize to get rid of this difference in accessing the
member(s)?
Thanks in advance.