Boost logo

Boost :

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2002-03-11 17:52:07


The std::complex discussion started out with discussing if std::complex
should be a POD (Dave had some great discussion with an EDG guy but the
archives are not active anymore, move to mailman I guess).

On the other hand, the discussion of creating a vector of complexes is
getting more and more complex. It has already been commented that scientists
fear C++ because of its complexity, so we should focus on simplicity as well
as functionality and performance.

So getting back to the basic question: why can't complex be a POD. If we
relax the POD requirements, changing the 'no constructor' requirement to
'must have none or at least a no-op default constructor'. If the developer
provides a constructor that takes no argument, the developer indicates that
no info is needed to get the object in a valid state (and it's up to the
developer if this constructor indeed puts the object in a valid state). If
the constructor body is empty (it's a no-op), the compiler knows he can
optimise the constructor away.
But I guess I'm forgetting something essential, isn't it ?

toon


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk