From 364f93ffa43fbec6ba5db9338cca609fe99bf685 Mon Sep 17 00:00:00 2001 From: Martin Moene Date: Thu, 4 May 2023 21:00:41 +0200 Subject: [PATCH] Fix to use forwarding reference (thanks @matthew-wozniczka, fixes #74) --- include/nonstd/optional.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/nonstd/optional.hpp b/include/nonstd/optional.hpp index c1e0f5d..51f2bcc 100644 --- a/include/nonstd/optional.hpp +++ b/include/nonstd/optional.hpp @@ -1555,7 +1555,7 @@ class optional void initialize( V && value ) { assert( ! has_value() ); - contained.construct_value( std::move( value ) ); + contained.construct_value( std::forward( value ) ); has_value_ = true; }