|
Boost : |
From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2006-03-11 21:55:12
"Václav Veselý" wrote:
> struct X
> {
> X* me; // Can points to the instance
> };
>
> seems to be POD, but it's not movable. The best implicit implamentation is
> probably the has_trivial_copy trait. For each other moveble type must be
> is_movable explicitly specialized. (BTW for compiler writers: compiler
> support for test a trait on all class members would be very useful for
> many
> such traits. And existing compilers with support of has_trivial_copy and
> similar traits must use this technique internally.)
>
> I think it worth it. For example I use optional<string> frequently. If you
> think that the is_movable trait is good enogh for Boost I would like write
> it including test and documentation.
>
Nonstandard Template Library (http://www.ntllib.org/) uses
extensively this feature (http://www.ntllib.org/moveable.html).
One of authors, Tomas Fidler, said that moveable has
noticeable impact on performance and that absolute majority
of classes he wrote are moveable, so he uses it as default option.
/Pavel
--===============1407236891==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
--===============1407236891==--
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk