Boost logo

Boost :

From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2003-08-26 13:31:04


"John Maddock" <boost.regex_at_[hidden]> wrote in message
news:036901c36bbd$0a68d7e0$29cb6b51_at_fuji...
> He needs to take a look at the has_trivial_* traits:
>
> has_trivial_assign is roughly equivalent to memcpy_copyable
>
> I guess there is no equivalent to memcpy_moveable: but it looks rather
> dangerous,
>
It looks dangerous but the memcpy_moveable is intended for containers
designed to deal with this danger.

(The problem can be a bit alleviated (in debug mode) by overwriting old
storage by 0xCC bit pattern, making invalid use easier to spot.)

Combination of is_POD and has_trivial_* covers many cases for
memcpy_moveable but not all of them, IMO. Also the has_trivial_* are not yet
supported by compilers.

My intention was to give user chance to flag moveable types manually. Those
causing performance bottleneck could be examined and flagged without need to
change container/algorithm/architecture.

Performance optimization is often targeted after system gets built and being
able to improve it without major design changes looks useful.

/Pavel


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