From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2002-10-21 10:28:27
This post is of relevance to those interested in move constructors. I only
post here as an announcement; I suggest is we discuss mojo on
The first failure of mojo gave insight into what could be done to eliminate
copying of temporaries.
You can find a complete redesign of mojo and a rewritten article that
describes the new design at http://moderncppdesign.com/mojo. The old design
and article have been saved at http://moderncppdesign.com/mojo/old.
The new design has the following characteristics:
(1) Offers portable 100% elimination of temporary copying if the user
follows some simple rules.
(2) The signature of functions returning objects must be changed to return
mojo::fnresult<T> when T was previously returned. The body of those
functions needs not to be changed in most cases.
(3) The function parameters must be changed following the "mojo protocol".
(4) Containers can be designed that support straight types, mojoed types,
and special "move-only" types such as owning pointers, expensive-to-copy
(5) Mojo is not 100% transparent; it never was; but the attempt was to make
it as transparent as humanly possible. Your mileage might vary, but overall
the result is fairly satisfactory.
You may want to discuss mojo on comp.lang.c++.moderated.
-- All new! THE C++ Seminar: Oct. 28-30 in Vancouver, WA. http://www.thecppseminar.com/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk