From: "Richard Peters" <R.A.Peters@[...].nl> > Then you can replace the postfix increment operator with> > number operator++(int)> { return postfix_increment(*this); }
Why not just:
number operator++(int)
{
return postfix_incrementer<number> (*this);
}
?
> The only thing is that I do not clearly see if there's still the copying> advantage...
I'm pretty sure there's not: the object will be copied again when it is
sliced for the return value. This one will work:
postfix_incrementer<number> operator++(int)
{
return postfix_incrementer<number> (*this);
}
But of course, the type identity of the result of the function has
changed... :(
-Dave
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost