mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
parent
dc3e7f9cf7
commit
11c89a5f7d
7
include/external/clara.hpp
vendored
7
include/external/clara.hpp
vendored
@ -5,7 +5,7 @@
|
|||||||
//
|
//
|
||||||
// See https://github.com/philsquared/Clara for more details
|
// See https://github.com/philsquared/Clara for more details
|
||||||
|
|
||||||
// Clara v1.1.3
|
// Clara v1.1.4
|
||||||
|
|
||||||
#ifndef CATCH_CLARA_HPP_INCLUDED
|
#ifndef CATCH_CLARA_HPP_INCLUDED
|
||||||
#define CATCH_CLARA_HPP_INCLUDED
|
#define CATCH_CLARA_HPP_INCLUDED
|
||||||
@ -21,6 +21,7 @@
|
|||||||
#ifndef CLARA_CONFIG_OPTIONAL_TYPE
|
#ifndef CLARA_CONFIG_OPTIONAL_TYPE
|
||||||
#ifdef __has_include
|
#ifdef __has_include
|
||||||
#if __has_include(<optional>) && __cplusplus >= 201703L
|
#if __has_include(<optional>) && __cplusplus >= 201703L
|
||||||
|
#include <optional>
|
||||||
#define CLARA_CONFIG_OPTIONAL_TYPE std::optional
|
#define CLARA_CONFIG_OPTIONAL_TYPE std::optional
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -665,11 +666,11 @@ namespace detail {
|
|||||||
}
|
}
|
||||||
#ifdef CLARA_CONFIG_OPTIONAL_TYPE
|
#ifdef CLARA_CONFIG_OPTIONAL_TYPE
|
||||||
template<typename T>
|
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;
|
T temp;
|
||||||
auto result = convertInto( source, temp );
|
auto result = convertInto( source, temp );
|
||||||
if( result )
|
if( result )
|
||||||
target = temp;
|
target = std::move(temp);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif // CLARA_CONFIG_OPTIONAL_TYPE
|
#endif // CLARA_CONFIG_OPTIONAL_TYPE
|
||||||
|
7
third_party/clara.hpp
vendored
7
third_party/clara.hpp
vendored
@ -5,7 +5,7 @@
|
|||||||
//
|
//
|
||||||
// See https://github.com/philsquared/Clara for more details
|
// See https://github.com/philsquared/Clara for more details
|
||||||
|
|
||||||
// Clara v1.1.3
|
// Clara v1.1.4
|
||||||
|
|
||||||
#ifndef CLARA_HPP_INCLUDED
|
#ifndef CLARA_HPP_INCLUDED
|
||||||
#define CLARA_HPP_INCLUDED
|
#define CLARA_HPP_INCLUDED
|
||||||
@ -21,6 +21,7 @@
|
|||||||
#ifndef CLARA_CONFIG_OPTIONAL_TYPE
|
#ifndef CLARA_CONFIG_OPTIONAL_TYPE
|
||||||
#ifdef __has_include
|
#ifdef __has_include
|
||||||
#if __has_include(<optional>) && __cplusplus >= 201703L
|
#if __has_include(<optional>) && __cplusplus >= 201703L
|
||||||
|
#include <optional>
|
||||||
#define CLARA_CONFIG_OPTIONAL_TYPE std::optional
|
#define CLARA_CONFIG_OPTIONAL_TYPE std::optional
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -665,11 +666,11 @@ namespace detail {
|
|||||||
}
|
}
|
||||||
#ifdef CLARA_CONFIG_OPTIONAL_TYPE
|
#ifdef CLARA_CONFIG_OPTIONAL_TYPE
|
||||||
template<typename T>
|
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;
|
T temp;
|
||||||
auto result = convertInto( source, temp );
|
auto result = convertInto( source, temp );
|
||||||
if( result )
|
if( result )
|
||||||
target = temp;
|
target = std::move(temp);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif // CLARA_CONFIG_OPTIONAL_TYPE
|
#endif // CLARA_CONFIG_OPTIONAL_TYPE
|
||||||
|
Loading…
Reference in New Issue
Block a user