A
Alex Vinokur
http://www.parashift.com/c++-faq-lite/virtual-functions.html#faq-20.6
Faq-20.6 contains function userCode(Shape&) :
void userCode(Shape& s)
{
Shape* s2 = s.clone();
Shape* s3 = s.create();
...
// stuff; for instance
// s2->draw();
delete s2;
delete s3;
}
Why don't use userCode2(Shape*) ?
void userCode2(Shape* s)
{
//stuff; for instance
// s->draw();
}
Faq-20.6 contains function userCode(Shape&) :
void userCode(Shape& s)
{
Shape* s2 = s.clone();
Shape* s3 = s.create();
...
// stuff; for instance
// s2->draw();
delete s2;
delete s3;
}
Why don't use userCode2(Shape*) ?
void userCode2(Shape* s)
{
//stuff; for instance
// s->draw();
}