Opened 13 years ago

Last modified 13 years ago

#3457 new Feature Requests

introduce move semantics to container types

Reported by: Gunter Owned by: Gunter
Milestone: Boost 1.41.0 Component: uBLAS
Version: Boost 1.40.0 Severity: Optimization
Keywords: Cc:

Description

I am writing many routines where I would strongly prefer: matrix<double> f(const matrix<double>& in) to void f(const matrix<double>& in, matrix<double>& out )

There has been a lot of discussion about this from the C++ groups:

Also, I see that this is native to MTL: http://www.osl.iu.edu/research/mtl/mtl4/doc/matrix_assignment.html#move_semantics

Change History (5)

comment:1 by Gunter, 13 years ago

(In [56248]) see #3457

  • test/manual/test_move_semantics.cpp: example and manual test case to demonstrate move semantics
  • test/manual/Jamfile.v2: added new target test_move_semantics
  • doc/ublas.css: added pre.screen class for code snippets, added p.credit class for thanks and credits
  • doc/overview.htm: fixed broken anchors and missing alt-attribute
  • doc/release_notes.htm: added new feature to release list
  • doc/options.htm: new page to document preprocessore switches (mostly copied from Wiki)
  • doc/index.htm: added link to options.htm

comment:2 by Gunter, 13 years ago

(In [56249]) see #3457

  • matrix.hpp: added move semantics
  • vector.hpp: added move semantics

comment:3 by nasos_i@…, 13 years ago

Because for the bounded and c types, the move semantics don't have any effect, I think they should be disabled for now for those types, so that they don't promise something that they don't do.

Also in the options.htm, I would propose the description to read:

An immediate effect of this option is the elimination of the need for noalias in types <tt>vector&lt;T&gt;</tt> and <tt>matrix&lt;T&gt;</tt>, when assigned to the same type. This option doesn't have an effect on bounded and c types. Although it is rare, not all compilers support copy elision (that allows for move semantics), so a test must be performed to make sure that there is a benefit when it is enabled. A small demonstration and test can be found in test/manual/test_move_semantics.cpp

comment:4 by Gunter, 13 years ago

(In [56622]) see #3457: introduce move semantics to container types (Incomplete)

  • updated description

comment:5 by Gunter, 13 years ago

(In [56623]) see #3457 and see #3443:

Note: See TracTickets for help on using tickets.