mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-16 18:52:25 +01:00
Define toString template before using toString calls
This commit is contained in:
parent
04a3364b5a
commit
2e3879f0e0
@ -96,6 +96,11 @@ struct StringMaker<T*> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
std::string toString( T const& value ) {
|
||||||
|
return StringMaker<T>::convert( value );
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct StringMaker<std::vector<T> > {
|
struct StringMaker<std::vector<T> > {
|
||||||
static std::string convert( std::vector<T> const& v ) {
|
static std::string convert( std::vector<T> const& v ) {
|
||||||
@ -125,10 +130,7 @@ namespace Detail {
|
|||||||
/// that and writes {?}.
|
/// that and writes {?}.
|
||||||
/// Overload (not specialise) this template for custom typs that you don't want
|
/// Overload (not specialise) this template for custom typs that you don't want
|
||||||
/// to provide an ostream overload for.
|
/// to provide an ostream overload for.
|
||||||
template<typename T>
|
|
||||||
std::string toString( T const& value ) {
|
|
||||||
return StringMaker<T>::convert( value );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Built in overloads
|
// Built in overloads
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user