|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r50516 - trunk/boost/lambda/detail
From: steven_at_[hidden]
Date: 2009-01-08 11:58:49
Author: steven_watanabe
Date: 2009-01-08 11:58:48 EST (Thu, 08 Jan 2009)
New Revision: 50516
URL: http://svn.boost.org/trac/boost/changeset/50516
Log:
Add specializations of plain_return_type_2 for std::string. Fixes #781
Text files modified:
trunk/boost/lambda/detail/operator_return_type_traits.hpp | 35 +++++++++++++++++++++++++++++++++++
trunk/boost/lambda/detail/operators.hpp | 26 +++++++++++++-------------
2 files changed, 48 insertions(+), 13 deletions(-)
Modified: trunk/boost/lambda/detail/operator_return_type_traits.hpp
==============================================================================
--- trunk/boost/lambda/detail/operator_return_type_traits.hpp (original)
+++ trunk/boost/lambda/detail/operator_return_type_traits.hpp 2009-01-08 11:58:48 EST (Thu, 08 Jan 2009)
@@ -933,6 +933,41 @@
typedef typename std::basic_string<Char, Traits, Allocator>::const_reference type;
};
+template<class Char, class Traits, class Allocator>
+struct plain_return_type_2<arithmetic_action<plus_action>,
+ std::basic_string<Char, Traits, Allocator>,
+ std::basic_string<Char, Traits, Allocator> > {
+ typedef std::basic_string<Char, Traits, Allocator> type;
+};
+
+template<class Char, class Traits, class Allocator>
+struct plain_return_type_2<arithmetic_action<plus_action>,
+ const Char*,
+ std::basic_string<Char, Traits, Allocator> > {
+ typedef std::basic_string<Char, Traits, Allocator> type;
+};
+
+template<class Char, class Traits, class Allocator>
+struct plain_return_type_2<arithmetic_action<plus_action>,
+ std::basic_string<Char, Traits, Allocator>,
+ const Char*> {
+ typedef std::basic_string<Char, Traits, Allocator> type;
+};
+
+template<class Char, class Traits, class Allocator, std::size_t N>
+struct plain_return_type_2<arithmetic_action<plus_action>,
+ Char[N],
+ std::basic_string<Char, Traits, Allocator> > {
+ typedef std::basic_string<Char, Traits, Allocator> type;
+};
+
+template<class Char, class Traits, class Allocator, std::size_t N>
+struct plain_return_type_2<arithmetic_action<plus_action>,
+ std::basic_string<Char, Traits, Allocator>,
+ Char[N]> {
+ typedef std::basic_string<Char, Traits, Allocator> type;
+};
+
} // namespace lambda
} // namespace boost
Modified: trunk/boost/lambda/detail/operators.hpp
==============================================================================
--- trunk/boost/lambda/detail/operators.hpp (original)
+++ trunk/boost/lambda/detail/operators.hpp 2009-01-08 11:58:48 EST (Thu, 08 Jan 2009)
@@ -258,17 +258,17 @@
#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<class Arg, int N, class B> \
inline const \
lambda_functor< \
- lambda_functor_base<ACTION, tuple<lambda_functor<Arg>, CONSTB(&)[N]> > \
+ lambda_functor_base<ACTION, tuple<lambda_functor<Arg>, CONSTB(&)[N]> > \
> \
-OPER_NAME (const lambda_functor<Arg>& a, CONSTB(&b)[N]) \
+OPER_NAME (const lambda_functor<Arg>& a, CONSTB(&b)[N]) \
{ \
- return lambda_functor< \
- lambda_functor_base<ACTION, tuple<lambda_functor<Arg>, CONSTB(&)[N]> > \
- >(tuple<lambda_functor<Arg>, CONSTB(&)[N]>(a, b)); \
+ return \
+ lambda_functor_base<ACTION, tuple<lambda_functor<Arg>, CONSTB(&)[N]> > \
+ (tuple<lambda_functor<Arg>, CONSTB(&)[N]>(a, b)); \
}
@@ -276,15 +276,15 @@
#error "Multiple defines of BOOST_LAMBDA_PTR_ARITHMETIC_E2"
#endif
-#define BOOST_LAMBDA_PTR_ARITHMETIC_E2(OPER_NAME, ACTION, CONSTA) \
-template<int N, class A, class Arg> \
-inline const \
-lambda_functor< \
+#define BOOST_LAMBDA_PTR_ARITHMETIC_E2(OPER_NAME, ACTION, CONSTA) \
+template<int N, class A, class Arg> \
+inline const \
+lambda_functor< \
lambda_functor_base<ACTION, tuple<CONSTA(&)[N], lambda_functor<Arg> > > \
-> \
+> \
OPER_NAME (CONSTA(&a)[N], const lambda_functor<Arg>& b) \
-{ \
- return \
+{ \
+ return \
lambda_functor_base<ACTION, tuple<CONSTA(&)[N], lambda_functor<Arg> > > \
(tuple<CONSTA(&)[N], lambda_functor<Arg> >(a, b)); \
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk