Define toString template before using toString calls

This commit is contained in:
Jérémy Lal 2013-09-07 00:44:58 +02:00
parent 04a3364b5a
commit 2e3879f0e0

View File

@ -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