|
|
|
| |||||
|
|
| ||||||
|
|
|||||||
|
|
home translate to German (by SYSTRAN)
|
|
|
Empty Base Class Optimizationsee Return Value Optimization.
struct A
{
inline A()
: copied_(0)
{ }
inline A(const A &)
: copied_(1)
{ }
inline A &operator =(const A &)
{
copied_ = 1;
return *this;
}
bool copied_;
};
A f()
{
A a;
return a;
}
int main(int argc, char *argv[])
{
A a = f();
return a.copied_ ? 1 : 0;
}
| |||
This Web page is licensed under the Creative Commons Attribution - NonCommercial - Share Alike License. Any use is subject to the Privacy Policy.
|
Revision: 1.1, http://cmeerw.org/prog/freecpp/return_value_opt.html Last modified: Sun Jan 13 23:54:42 2002 |
Christof Meerwald <cmeerw@cmeerw.org> XMPP: cmeerw@cmeerw.org |