Subject: Re: [boost] [optional] generates unnessesary code for trivial types
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2012-02-14 15:16:07
Simonson, Lucanus J wrote:
> You could say I
> should have used a reference instead, but it might not have been my
> pointer to start with.
> Specifically, polymorphic data types are often
> passed around by pointer to base class instead of reference to base
> class by most C++ programmers.
This doesn't convince me. If the pointer can't be zero (and if somebody else owns it), there is no good reason not to use a reference. Well, if the pointer is a class member, using a reference might be impossible.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk