From 62878a6d0610bb54b68fc2d70f46c955994bcc2d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 1 Dec 2025 03:03:57 +0200 Subject: [PATCH] Update documentation --- doc/system/reference.adoc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/system/reference.adoc b/doc/system/reference.adoc index 6a1f0b4..8517458 100644 --- a/doc/system/reference.adoc +++ b/doc/system/reference.adoc @@ -2518,8 +2518,8 @@ Returns: :: #### operator| ``` -template T operator|( result const& r, U&& u ); -template T operator|( result&& r, U&& u ); +template std::decay_t operator|( result const& r, U&& u ); +template std::decay_t operator|( result&& r, U&& u ); ``` [none] * {blank} @@ -2530,7 +2530,7 @@ Effects: :: - If `r.has_value()` is `true`, returns `*r`. - Otherwise, returns `u`. Remarks: :: - Only enabled when `U` is convertible to `T`. + Only enabled when `U` is convertible to `std::decay_t`. Example: :: + ``` @@ -2545,6 +2545,7 @@ int get_port() ``` template T operator|( result const& r, F&& f ); template T operator|( result&& r, F&& f ); +template std::decay_t operator|( result const& r, F&& f ); ``` [none] * {blank} @@ -2556,7 +2557,7 @@ Effects: :: - If `r.has_value()` is `true`, returns `*r`. - Otherwise, returns `f()`. Remarks: :: - Only enabled when `f()` is convertible to `T`. + Only enabled when `f()` is convertible to `T`, or, when `T` is a reference, to `std::decay_t`. Example: :: + ```