C++17で追加された機能、値のコピー省略を保証について、規格のどこにこの記述があるのかわかる方がいましたら、ご教授お願いいたします。
コンパイラの実装状況などでは、この機能についての参照にp0135r1が挙げられています。
また、n4659 [class.copy.elision]も関係しそうだと思います。[class.copy.elision]/1.1 に、次の記述があります。
in a return statement in a function with a class return type, when the expression is the name of a non-volatile automatic object (other than a function parameter or a variable introduced by the exception-declaration of a handler (18.3)) with the same type (ignoring cv-qualification) as the function return type, the copy/move operation can be omitted by constructing the automatic object directly into the function call’s return object
(NRVOはどのように、保証されないのでしょうか)
まだ回答がついていません
会員登録して回答してみよう