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

« back to all changes in this revision

Viewing changes to yo/memory/moveassignment.yo

  • Committer: Package Import Robot
  • Author(s): Frank B. Brokken
  • Date: 2012-01-20 11:53:17 UTC
  • mfrom: (1.1.18)
  • Revision ID: package-import@ubuntu.com-20120120115317-v4wiq9sttx72fabk
Tags: 9.1.0-1
New upstream release (covering C++11 to a large extend)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
In addition to the overloaded assignment operator a emi(move assignment)
2
 
operator could be implemented for classes supporting move operations. In this
 
2
operator may be implemented for classes supporting move operations. In this
3
3
case, if the class supports swapping the implementation is surprisingly
4
4
simple. No copy construction is required and the move assignment operator can
5
5
simply be implemented like this:
22
22
        return *this;
23
23
    }
24
24
        )
 
25
    As noted previously (section(MOVECONS)) declaring a move assignment
 
26
operator suppresses the default availability of the copy constructor. It is
 
27
made available again by declaring the copy constructor in the class's
 
28
interface (and of course by providing an explicit implementation or by using
 
29
the tt(= default) default implementation).