From d5a98758fa903eeea10f4401053d808cb64ef911 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Thu, 8 Jan 2009 16:58:48 +0000 Subject: [PATCH] Add specializations of plain_return_type_2 for std::string. Fixes #781 [SVN r50516] --- .../detail/operator_return_type_traits.hpp | 35 +++++++++++++++++++ include/boost/lambda/detail/operators.hpp | 26 +++++++------- 2 files changed, 48 insertions(+), 13 deletions(-) diff --git a/include/boost/lambda/detail/operator_return_type_traits.hpp b/include/boost/lambda/detail/operator_return_type_traits.hpp index 913fa86..4f6a84f 100644 --- a/include/boost/lambda/detail/operator_return_type_traits.hpp +++ b/include/boost/lambda/detail/operator_return_type_traits.hpp @@ -933,6 +933,41 @@ struct plain_return_type_2, const std::basic_stri typedef typename std::basic_string::const_reference type; }; +template +struct plain_return_type_2, + std::basic_string, + std::basic_string > { + typedef std::basic_string type; +}; + +template +struct plain_return_type_2, + const Char*, + std::basic_string > { + typedef std::basic_string type; +}; + +template +struct plain_return_type_2, + std::basic_string, + const Char*> { + typedef std::basic_string type; +}; + +template +struct plain_return_type_2, + Char[N], + std::basic_string > { + typedef std::basic_string type; +}; + +template +struct plain_return_type_2, + std::basic_string, + Char[N]> { + typedef std::basic_string type; +}; + } // namespace lambda } // namespace boost diff --git a/include/boost/lambda/detail/operators.hpp b/include/boost/lambda/detail/operators.hpp index 4fdece2..29eb106 100644 --- a/include/boost/lambda/detail/operators.hpp +++ b/include/boost/lambda/detail/operators.hpp @@ -258,17 +258,17 @@ operator>>(const lambda_functor& a, Ret(&b)(ManipArg)) #error "Multiple defines of BOOST_LAMBDA_PTR_ARITHMETIC_E1" #endif -#define BOOST_LAMBDA_PTR_ARITHMETIC_E1(OPER_NAME, ACTION, CONSTB) \ +#define BOOST_LAMBDA_PTR_ARITHMETIC_E1(OPER_NAME, ACTION, CONSTB) \ template \ inline const \ lambda_functor< \ - lambda_functor_base, CONSTB(&)[N]> > \ + lambda_functor_base, CONSTB(&)[N]> > \ > \ -OPER_NAME (const lambda_functor& a, CONSTB(&b)[N]) \ +OPER_NAME (const lambda_functor& a, CONSTB(&b)[N]) \ { \ - return lambda_functor< \ - lambda_functor_base, CONSTB(&)[N]> > \ - >(tuple, CONSTB(&)[N]>(a, b)); \ + return \ + lambda_functor_base, CONSTB(&)[N]> > \ + (tuple, CONSTB(&)[N]>(a, b)); \ } @@ -276,15 +276,15 @@ OPER_NAME (const lambda_functor& a, CONSTB(&b)[N]) \ #error "Multiple defines of BOOST_LAMBDA_PTR_ARITHMETIC_E2" #endif -#define BOOST_LAMBDA_PTR_ARITHMETIC_E2(OPER_NAME, ACTION, CONSTA) \ -template \ -inline const \ -lambda_functor< \ +#define BOOST_LAMBDA_PTR_ARITHMETIC_E2(OPER_NAME, ACTION, CONSTA) \ +template \ +inline const \ +lambda_functor< \ lambda_functor_base > > \ -> \ +> \ OPER_NAME (CONSTA(&a)[N], const lambda_functor& b) \ -{ \ - return \ +{ \ + return \ lambda_functor_base > > \ (tuple >(a, b)); \ }