~ubuntu-branches/ubuntu/trusty/c++-annotations/trusty

« back to all changes in this revision

Viewing changes to yo/inheritance/move.yo

  • Committer: Package Import Robot
  • Author(s): tony mancill, Frank B. Brokken, tony mancill
  • Date: 2014-01-18 08:55:27 UTC
  • mfrom: (1.1.26)
  • Revision ID: package-import@ubuntu.com-20140118085527-ph5upqqn423cmnmz
Tags: 9.8.0-1
[ Frank B. Brokken ]
* New upstream release, adds a section about static polymorphism, removes
  the concrete/a2x section, and removes C++11 indicators from the section
  headers. 

[ tony mancill ]
* Use debhelper 9.
* Tweak build-deps for g++ to use >= 4.8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
implementing the move constructor to move the information in base classes or
14
14
composed objects to their new destination object.
15
15
 
16
 
    The first example shows the move constructor for the class tt(Auto),
 
16
    The first example shows the move constructor for the class tt(Car),
17
17
assuming it has a movable tt(char *d_brandName) data member and
18
18
assuming that tt(Land) is a move-aware class. The second example shows the
19
19
move constructor for the class tt(Land), assuming that it does not itself have
20
20
movable data members, but that its tt(Vehicle) base class is move-aware:
21
21
        verb(
22
 
    Auto::Auto(Auto &&tmp)
 
22
    Car::Car(Car &&tmp)
23
23
    :
24
24
        Land(std::move(tmp)),           // anonimize `tmp'
25
25
        d_brandName(tmp.d_brandName)    // move the char *'s value