Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Bring in Clara v1.1.4

This fixes #1214
Commit
11c89a5f7de008c2a21c9cd2a6b96d94f9a55cef
Author
Martin Hořeňovský ·
Parents
dc3e7f9cf762

Files · Download .tar.gz

Changes

 include/external/clara.hpp | 7 ++++---
 third_party/clara.hpp      | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/external/clara.hpp b/include/external/clara.hpp
index 1762651f..3a7f8836 100644
--- a/include/external/clara.hpp
+++ b/include/external/clara.hpp
@@ -5,7 +5,7 @@
 //
 // See https://github.com/philsquared/Clara for more details
 
-// Clara v1.1.3
+// Clara v1.1.4
 
 #ifndef CATCH_CLARA_HPP_INCLUDED
 #define CATCH_CLARA_HPP_INCLUDED
@@ -21,6 +21,7 @@
 #ifndef CLARA_CONFIG_OPTIONAL_TYPE
 #ifdef __has_include
 #if __has_include(<optional>) && __cplusplus >= 201703L
+#include <optional>
 #define CLARA_CONFIG_OPTIONAL_TYPE std::optional
 #endif
 #endif
@@ -665,11 +666,11 @@ namespace detail {
     }
 #ifdef CLARA_CONFIG_OPTIONAL_TYPE
     template<typename T>
-    inline auto convertInto( std::string const &source, std::optional<T>& target ) -> ParserResult {
+    inline auto convertInto( std::string const &source, CLARA_CONFIG_OPTIONAL_TYPE<T>& target ) -> ParserResult {
         T temp;
         auto result = convertInto( source, temp );
         if( result )
-            target = temp;
+            target = std::move(temp);
         return result;
     }
 #endif // CLARA_CONFIG_OPTIONAL_TYPE
diff --git a/third_party/clara.hpp b/third_party/clara.hpp
index 257ba10f..43568cee 100644
--- a/third_party/clara.hpp
+++ b/third_party/clara.hpp
@@ -5,7 +5,7 @@
 //
 // See https://github.com/philsquared/Clara for more details
 
-// Clara v1.1.3
+// Clara v1.1.4
 
 #ifndef CLARA_HPP_INCLUDED
 #define CLARA_HPP_INCLUDED
@@ -21,6 +21,7 @@
 #ifndef CLARA_CONFIG_OPTIONAL_TYPE
 #ifdef __has_include
 #if __has_include(<optional>) && __cplusplus >= 201703L
+#include <optional>
 #define CLARA_CONFIG_OPTIONAL_TYPE std::optional
 #endif
 #endif
@@ -665,11 +666,11 @@ namespace detail {
     }
 #ifdef CLARA_CONFIG_OPTIONAL_TYPE
     template<typename T>
-    inline auto convertInto( std::string const &source, std::optional<T>& target ) -> ParserResult {
+    inline auto convertInto( std::string const &source, CLARA_CONFIG_OPTIONAL_TYPE<T>& target ) -> ParserResult {
         T temp;
         auto result = convertInto( source, temp );
         if( result )
-            target = temp;
+            target = std::move(temp);
         return result;
     }
 #endif // CLARA_CONFIG_OPTIONAL_TYPE