G
Grizlyk
Hello.
Can compiler garantee equal optimization in the following example for
reference "named_ref" as for "named_function"? How I can declare that the
"named_ref" always will returns "*this"?
// ***
class A
{
public:
A &named_ref;
A &named_function(){ return *this; }
A():named_ref(*this){}
};
// ***
A a;
A& foo()
{
return a.named_ref;
}
A& boo()
{
return a.named_function();
}
--
Maksim A. Polyanin
http://grizlyk1.narod.ru/cpp_new
"In thi world of fairy tales rolls are liked olso"
/Gnume/
Can compiler garantee equal optimization in the following example for
reference "named_ref" as for "named_function"? How I can declare that the
"named_ref" always will returns "*this"?
// ***
class A
{
public:
A &named_ref;
A &named_function(){ return *this; }
A():named_ref(*this){}
};
// ***
A a;
A& foo()
{
return a.named_ref;
}
A& boo()
{
return a.named_function();
}
--
Maksim A. Polyanin
http://grizlyk1.narod.ru/cpp_new
"In thi world of fairy tales rolls are liked olso"
/Gnume/