Aug 3, 2014

[C++11]default move constructor as noexcept

Is the default Move constructor defined as noexcept?

An inheriting constructor (12.9) and an implicitly declared special member function (Clause 12) have an exception-specification.

If f is an

  • inheriting constructor 
  • implicitly declared 
    • default constructor
    • copy constructor
    • move constructor
    • destructor
    • copy assignment operator
    • move assignment operator
its implicit exception-specification specifies the type-id T if and only if T is allowed by the exception-specification of a function directly invoked by f’s implicit definition;

f allows all exceptions if any function it directly invokes allows all exceptions, and f has the exception-specification noexcept(true) if every function it directly invokes allows no exceptions.

------------
std::allocator{} is _noexcept_

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.