mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-29 16:53:30 +01:00
Remove double serialization when stringifying std::optional
This commit is contained in:
parent
928e198ef2
commit
d65ee04b74
@ -388,13 +388,11 @@ namespace Catch {
|
||||
template<typename T>
|
||||
struct StringMaker<std::optional<T> > {
|
||||
static std::string convert(const std::optional<T>& optional) {
|
||||
ReusableStringStream rss;
|
||||
if (optional.has_value()) {
|
||||
rss << ::Catch::Detail::stringify(*optional);
|
||||
return ::Catch::Detail::stringify(*optional);
|
||||
} else {
|
||||
rss << "{ }";
|
||||
return "{ }";
|
||||
}
|
||||
return rss.str();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user