From 51c897f5879d7d6bcf4d1fbb16cc471b1e01a622 Mon Sep 17 00:00:00 2001 From: Martin Moene Date: Tue, 1 Apr 2014 09:56:04 +0200 Subject: [PATCH] Add missing inline --- CHANGES.txt | 5 +++++ lest_cpp03.hpp | 8 ++++---- lest_decompose.hpp | 8 ++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 528fe4c..462dae9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,11 @@ Changes for lest – lest errors escape testing +version 1.7.4 2014-04-01 + +- Add missing inline to to_string() functions. + + version 1.7.3 2014-02-06 - Restore formatting of Readme.md (trailing double spaces). diff --git a/lest_cpp03.hpp b/lest_cpp03.hpp index 49cb023..db8ca7b 100644 --- a/lest_cpp03.hpp +++ b/lest_cpp03.hpp @@ -230,11 +230,11 @@ int run( C const & specification, std::ostream & os = std::cout ) // Expression decomposition: #if __cplusplus >= 201103L -std::string to_string( std::nullptr_t const & ) { return "nullptr"; } +inline std::string to_string( std::nullptr_t const & ) { return "nullptr"; } #endif -std::string to_string( std::string const & text ) { return "\"" + text + "\"" ; } -std::string to_string( char const * const & text ) { return "\"" + std::string( text ) + "\"" ; } -std::string to_string( char const & text ) { return "\'" + std::string( 1, text ) + "\'" ; } +inline std::string to_string( std::string const & text ) { return "\"" + text + "\"" ; } +inline std::string to_string( char const * const & text ) { return "\"" + std::string( text ) + "\"" ; } +inline std::string to_string( char const & text ) { return "\'" + std::string( 1, text ) + "\'" ; } template std::string to_string( T const & value ) diff --git a/lest_decompose.hpp b/lest_decompose.hpp index 8245e74..b5d491e 100644 --- a/lest_decompose.hpp +++ b/lest_decompose.hpp @@ -190,10 +190,10 @@ int run( test const (&specification)[N], std::ostream & os = std::cout ) // Expression decomposition: -std::string to_string( std::nullptr_t const & ) { return "nullptr"; } -std::string to_string( std::string const & text ) { return "\"" + text + "\"" ; } -std::string to_string( char const * const & text ) { return "\"" + std::string( text ) + "\"" ; } -std::string to_string( char const & text ) { return "\'" + std::string( 1, text ) + "\'" ; } +inline std::string to_string( std::nullptr_t const & ) { return "nullptr"; } +inline std::string to_string( std::string const & text ) { return "\"" + text + "\"" ; } +inline std::string to_string( char const * const & text ) { return "\"" + std::string( text ) + "\"" ; } +inline std::string to_string( char const & text ) { return "\'" + std::string( 1, text ) + "\'" ; } // not using std::true_type to prevent warning: ...has a non-virtual destructor [-Weffc++]: