From 87a2cb4b8b9515b3e70ece31db05c6a5f68ff708 Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Sat, 21 Jul 2012 02:15:04 -0400 Subject: [PATCH] lib: trim.h: make wrapper function inline, put in namespace, and keep std:: I've run into compile trouble if some functions are not inline, in headers. Should keep this wrapper function inside the same namespace as the trim functions. The previous code used std::isspace(), so attempt to continue using it. I don't know if this compiles on WinCE. Since this changes inline functions definitions, I'm assuming it could break the ABI, so postpone for 0.19.0. --- src/trim.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/trim.h b/src/trim.h index eb7959b6..2c2f615e 100644 --- a/src/trim.h +++ b/src/trim.h @@ -12,14 +12,14 @@ #include #include -// Windows CE defines std::isspace(int) as a macro to a function with two arguments -// with one prefilled, so a wrapper function is needed. -static int isSpaceChar(int c) { - return ::isspace(c); -} - namespace Barry { namespace Inplace { +// Windows CE defines std::isspace(int) as a macro to a function with +// two arguments with one prefilled, so a wrapper function is needed. +static inline int isSpaceChar(int c) { + return std::isspace(c); +} + // trim from start static inline std::string <rim(std::string &s) { std::string::iterator end(std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(isSpaceChar)))); -- 2.11.4.GIT