Boost logo

Boost :

Subject: Re: [boost] boost::mpl::for_each_impl() still not inlined
From: Peter Foelsche (peter_foelsche_at_[hidden])
Date: 2010-01-07 16:46:23


"Peter Foelsche" <peter_foelsche_at_[hidden]> wrote in message
news:hi5bfc$gap$1_at_ger.gmane.org...

below are my patches for boost_1_41_0 -- these are dealing with inlining and

boost::lambda::if_then_else_return

not being able to deal with different return types in the true vs. else
branch.

Peter

diff -wru ./boost/lambda/detail/actions.hpp
/users/pfoelsch/boost_1_41_0/boost/lambda/detail/actions.hpp
--- ./boost/lambda/detail/actions.hpp 2010-01-07 10:38:28.402819000 -0800
+++ /users/pfoelsch/boost_1_41_0/boost/lambda/detail/actions.hpp 2008-06-28
06:57:20.000000000 -0700
@@ -73,7 +73,7 @@
 template<class T> class function_action<1, T> {
 public:
   template<class RET, class A1>
- inline static RET apply(A1& a1) {
+ static RET apply(A1& a1) {
     return function_adaptor<typename boost::remove_cv<A1>::type>::
       template apply<RET>(a1);
   }
@@ -82,7 +82,7 @@
 template<class T> class function_action<2, T> {
 public:
   template<class RET, class A1, class A2>
- inline static RET apply(A1& a1, A2& a2) {
+ static RET apply(A1& a1, A2& a2) {
     return function_adaptor<typename boost::remove_cv<A1>::type>::
       template apply<RET>(a1, a2);
   }
@@ -91,7 +91,7 @@
 template<class T> class function_action<3, T> {
 public:
   template<class RET, class A1, class A2, class A3>
- inline static RET apply(A1& a1, A2& a2, A3& a3) {
+ static RET apply(A1& a1, A2& a2, A3& a3) {
     return function_adaptor<typename boost::remove_cv<A1>::type>::
       template apply<RET>(a1, a2, a3);
   }
@@ -100,7 +100,7 @@
 template<class T> class function_action<4, T> {
 public:
   template<class RET, class A1, class A2, class A3, class A4>
- inline static RET apply(A1& a1, A2& a2, A3& a3, A4& a4) {
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4) {
     return function_adaptor<typename boost::remove_cv<A1>::type>::
       template apply<RET>(a1, a2, a3, a4);
   }
@@ -109,7 +109,7 @@
 template<class T> class function_action<5, T> {
 public:
   template<class RET, class A1, class A2, class A3, class A4, class A5>
- inline static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
     return function_adaptor<typename boost::remove_cv<A1>::type>::
       template apply<RET>(a1, a2, a3, a4, a5);
   }
@@ -119,7 +119,7 @@
 public:
   template<class RET, class A1, class A2, class A3, class A4, class A5,
            class A6>
- inline static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6) {
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6) {
     return function_adaptor<typename boost::remove_cv<A1>::type>::
       template apply<RET>(a1, a2, a3, a4, a5, a6);
   }
@@ -129,7 +129,7 @@
 public:
   template<class RET, class A1, class A2, class A3, class A4, class A5,
            class A6, class A7>
- inline static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6,
A7& a7) {
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7)
{
     return function_adaptor<typename boost::remove_cv<A1>::type>::
       template apply<RET>(a1, a2, a3, a4, a5, a6, a7);
   }
@@ -139,7 +139,7 @@
 public:
   template<class RET, class A1, class A2, class A3, class A4, class A5,
            class A6, class A7, class A8>
- inline static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6,
A7& a7,
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7,
                    A8& a8) {
     return function_adaptor<typename boost::remove_cv<A1>::type>::
       template apply<RET>(a1, a2, a3, a4, a5, a6, a7, a8);
@@ -150,7 +150,7 @@
 public:
   template<class RET, class A1, class A2, class A3, class A4, class A5,
            class A6, class A7, class A8, class A9>
- inline static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6,
A7& a7,
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7,
                    A8& a8, A9& a9) {
     return function_adaptor<typename boost::remove_cv<A1>::type>::
       template apply<RET>(a1, a2, a3, a4, a5, a6, a7, a8, a9);
@@ -161,7 +161,7 @@
 public:
   template<class RET, class A1, class A2, class A3, class A4, class A5,
            class A6, class A7, class A8, class A9, class A10>
- inline static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6,
A7& a7,
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7,
                    A8& a8, A9& a9, A10& a10) {
     return function_adaptor<typename boost::remove_cv<A1>::type>::
       template apply<RET>(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
diff -wru ./boost/lambda/detail/lambda_functors.hpp
/users/pfoelsch/boost_1_41_0/boost/lambda/detail/lambda_functors.hpp
--- ./boost/lambda/detail/lambda_functors.hpp 2010-01-07
12:16:50.333271000 -0800
+++ /users/pfoelsch/boost_1_41_0/boost/lambda/detail/lambda_functors.hpp
2009-06-13 14:18:10.000000000 -0700
@@ -161,14 +161,14 @@
     inherited::template sig<null_type>::type
       nullary_return_type;

- inline nullary_return_type operator()() const {
+ nullary_return_type operator()() const {
     return inherited::template
       call<nullary_return_type>
         (cnull_type(), cnull_type(), cnull_type(), cnull_type());
   }

   template<class A>
- inline typename inherited::template sig<tuple<A&> >::type
+ typename inherited::template sig<tuple<A&> >::type
   operator()(A& a) const {
     return inherited::template call<
       typename inherited::template sig<tuple<A&> >::type
@@ -176,7 +176,7 @@
   }

   template<class A>
- inline BOOST_LAMBDA_DISABLE_IF_ARRAY1(A, inherited::template sig<tuple<A
const&> >)
+ BOOST_LAMBDA_DISABLE_IF_ARRAY1(A, inherited::template sig<tuple<A const&>
>)
   operator()(A const& a) const {
     return inherited::template call<
       typename inherited::template sig<tuple<A const&> >::type
@@ -184,7 +184,7 @@
   }

   template<class A, class B>
- inline typename inherited::template sig<tuple<A&, B&> >::type
+ typename inherited::template sig<tuple<A&, B&> >::type
   operator()(A& a, B& b) const {
     return inherited::template call<
       typename inherited::template sig<tuple<A&, B&> >::type
@@ -192,7 +192,7 @@
   }

   template<class A, class B>
- inline BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template
sig<tuple<A const&, B&> >)
+ BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template sig<tuple<A
const&, B&> >)
   operator()(A const& a, B& b) const {
     return inherited::template call<
       typename inherited::template sig<tuple<A const&, B&> >::type
@@ -200,7 +200,7 @@
   }

   template<class A, class B>
- inline BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template
sig<tuple<A&, B const&> >)
+ BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template sig<tuple<A&, B
const&> >)
   operator()(A& a, B const& b) const {
     return inherited::template call<
       typename inherited::template sig<tuple<A&, B const&> >::type
@@ -208,7 +208,7 @@
   }

   template<class A, class B>
- inline BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template
sig<tuple<A const&, B const&> >)
+ BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template sig<tuple<A
const&, B const&> >)
   operator()(A const& a, B const& b) const {
     return inherited::template call<
       typename inherited::template sig<tuple<A const&, B const&> >::type
@@ -216,7 +216,7 @@
   }

   template<class A, class B, class C>
- inline typename inherited::template sig<tuple<A&, B&, C&> >::type
+ typename inherited::template sig<tuple<A&, B&, C&> >::type
   operator()(A& a, B& b, C& c) const
   {
     return inherited::template call<
@@ -225,7 +225,7 @@
   }

   template<class A, class B, class C>
- inline BOOST_LAMBDA_DISABLE_IF_ARRAY3(A, B, C, inherited::template
sig<tuple<A const&, B const&, C const&> >)
+ BOOST_LAMBDA_DISABLE_IF_ARRAY3(A, B, C, inherited::template sig<tuple<A
const&, B const&, C const&> >)
   operator()(A const& a, B const& b, C const& c) const
   {
     return inherited::template call<
@@ -235,7 +235,7 @@

   // for internal calls with env
   template<CALL_TEMPLATE_ARGS>
- inline typename inherited::template sig<tuple<CALL_REFERENCE_TYPES>
>::type
+ typename inherited::template sig<tuple<CALL_REFERENCE_TYPES> >::type
   internal_call(CALL_FORMAL_ARGS) const {
      return inherited::template
        call<typename inherited::template
@@ -243,7 +243,7 @@
   }

   template<class A>
- inline const lambda_functor<lambda_functor_base<
+ const lambda_functor<lambda_functor_base<
                   other_action<assignment_action>,
                   boost::tuple<lambda_functor,
                   typename const_copy_argument <const A>::type> > >
@@ -257,7 +257,7 @@
   }

   template<class A>
- inline const lambda_functor<lambda_functor_base<
+ const lambda_functor<lambda_functor_base<
                   other_action<subscript_action>,
                   boost::tuple<lambda_functor,
                         typename const_copy_argument <const A>::type> > >
diff -wru ./boost/lambda/if.hpp
/users/pfoelsch/boost_1_41_0/boost/lambda/if.hpp
--- ./boost/lambda/if.hpp 2010-01-07 10:54:07.502623000 -0800
+++ /users/pfoelsch/boost_1_41_0/boost/lambda/if.hpp 2008-06-28
06:57:20.000000000 -0700
@@ -310,9 +310,9 @@
   template<class RET, CALL_TEMPLATE_ARGS>
   RET call(CALL_FORMAL_ARGS) const {
     return (detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS))
?
- RET(detail::select(boost::tuples::get<1>(args), CALL_ACTUAL_ARGS))
+ detail::select(boost::tuples::get<1>(args), CALL_ACTUAL_ARGS)
     :
- RET(detail::select(boost::tuples::get<2>(args), CALL_ACTUAL_ARGS));
+ detail::select(boost::tuples::get<2>(args), CALL_ACTUAL_ARGS);
   }
 };

diff -wru ./boost/mpl/for_each.hpp
/users/pfoelsch/boost_1_41_0/boost/mpl/for_each.hpp
--- ./boost/mpl/for_each.hpp 2010-01-07 12:32:13.977802000 -0800
+++ /users/pfoelsch/boost_1_41_0/boost/mpl/for_each.hpp 2009-08-17
22:16:53.000000000 -0700
@@ -40,7 +40,7 @@
         , typename TransformFunc
         , typename F
>
- inline static void execute(
+ static void execute(
           Iterator*
         , LastIterator*
         , TransformFunc*
@@ -59,7 +59,7 @@
         , typename TransformFunc
         , typename F
>
- inline static void execute(
+ static void execute(
           Iterator*
         , LastIterator*
         , TransformFunc*
diff -wru ./boost/utility/value_init.hpp
/users/pfoelsch/boost_1_41_0/boost/utility/value_init.hpp
--- ./boost/utility/value_init.hpp 2010-01-07 12:50:55.734734000 -0800
+++ /users/pfoelsch/boost_1_41_0/boost/utility/value_init.hpp 2009-11-04
17:48:23.000000000 -0800
@@ -55,7 +55,7 @@

   public :

- inline value_initialized()
+ value_initialized()
     {
       std::memset(&x, 0, sizeof(x));
 #ifdef BOOST_MSVC


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk