13 Asynchronous model [async]

13.2 Requirements [async.reqmts]

13.2.7 Requirements on asynchronous operations [async.reqmts.async]

13.2.7.5 Lifetime of initiating function arguments [async.reqmts.async.lifetime]

Unless otherwise specified, the lifetime of arguments to initiating functions shall be treated as follows:

  • If the parameter has a pointer type or has a type of lvalue reference to non-const, the implementation may assume the validity of the pointee or referent, respectively, until the completion handler is invoked. [ Note: In other words, the program is responsible for guaranteeing the validity of the argument until the completion handler is invoked.  — end note ]

  • Otherwise, the implementation does not assume the validity of the argument after the initiating function completes. [ Note: In other words, the program is not required to guarantee the validity of the argument after the initiating function completes.  — end note ] The implementation may make copies of the argument, and all copies shall be destroyed no later than immediately after invocation of the completion handler.