From ece71199a9e30789f98297a33f98f8071d9607ad Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 18 Oct 2022 04:15:40 +0300 Subject: [PATCH] Document result<>::emplace --- doc/system/reference.adoc | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/doc/system/reference.adoc b/doc/system/reference.adoc index a35989e..d5ab46f 100644 --- a/doc/system/reference.adoc +++ b/doc/system/reference.adoc @@ -1659,6 +1659,11 @@ public: constexpr E error() const; + // emplace + + template + constexpr T& emplace( A&&... a ); + // swap constexpr void swap( result& r ); @@ -1854,6 +1859,20 @@ constexpr E error() const; Effects: :: If `*this` holds an error, returns it. Otherwise, returns `E()`. +#### emplace + +``` +template + constexpr T& emplace( A&&... a ); +``` +[none] +* {blank} ++ +Ensures: :: + `*this` holds the value `T( std::forward(a)... )`. +Returns: :: + A reference to the contained value. + #### swap ``` @@ -1962,6 +1981,10 @@ public: constexpr E error() const; + // emplace + + constexpr void emplace(); + // swap constexpr void swap( result& r ); @@ -2105,6 +2128,17 @@ constexpr E error() const; Effects: :: If `*this` holds an error, returns it. Otherwise, returns `E()`. +#### emplace + +``` +constexpr void emplace(); +``` +[none] +* {blank} ++ +Ensures: :: + `*this` holds an unspecified value. + #### swap ```