mirror of
https://github.com/catchorg/Catch2.git
synced 2025-11-05 14:39:32 +01:00
Publish toString support for pairs
Catch::toString support for pairs was implemented and tested but not accessible from the include folder (thus in releases).
This commit is contained in:
@@ -186,6 +186,19 @@ std::string toString( std::vector<T,Allocator> const& v ) {
|
||||
return Detail::rangeToString( v.begin(), v.end() );
|
||||
}
|
||||
|
||||
// toString for pairs
|
||||
template<typename T1, typename T2>
|
||||
struct StringMaker<std::pair<T1,T2> > {
|
||||
static std::string convert( const std::pair<T1,T2>& pair ) {
|
||||
std::ostringstream oss;
|
||||
oss << "{ "
|
||||
<< toString( pair.first )
|
||||
<< ", "
|
||||
<< toString( pair.second )
|
||||
<< " }";
|
||||
return oss.str();
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef CATCH_CONFIG_CPP11_TUPLE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user