mirror of
https://github.com/catchorg/Catch2.git
synced 2026-07-21 13:53:35 +00:00
Workaround P3168 causing ambiguous overload issues with StringMaker
P3168 turned `std::optional` into a range type, so the partial specialization of `StringMaker` for `std::optional<T>` conflicted with the partial specialization for range types. Ideally we will fix this in the future to support user-provided partial specializations for range-like types, but for now we just disable the partial specialization for `std::optional<T>` if P3168 is implemented.
This commit is contained in:
@@ -384,7 +384,10 @@ namespace Catch {
|
||||
}
|
||||
#endif // CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
|
||||
|
||||
#if defined(CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_OPTIONAL)
|
||||
#if defined( CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER ) && \
|
||||
defined( CATCH_CONFIG_CPP17_OPTIONAL ) && \
|
||||
/* P3168 turned optional into a range, making this ambigous with the range support */ \
|
||||
!defined( __cpp_lib_optional_range_support )
|
||||
#include <optional>
|
||||
namespace Catch {
|
||||
template<typename T>
|
||||
|
||||
Reference in New Issue
Block a user