Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/units/lambda.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Boost.Units - A C++ library for zero-overhead dimensional analysis and
0002 // unit/quantity manipulation and conversion
0003 //
0004 // Copyright (C) 2003-2008 Matthias Christian Schabel
0005 // Copyright (C) 2008 Steven Watanabe
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See
0008 // accompanying file LICENSE_1_0.txt or copy at
0009 // http://www.boost.org/LICENSE_1_0.txt)
0010 
0011 // $Id: lambda.hpp 27 2008-06-16 14:50:58Z maehne $
0012 
0013 #ifndef BOOST_UNITS_LAMBDA_HPP
0014 #define BOOST_UNITS_LAMBDA_HPP
0015 
0016 
0017 ////////////////////////////////////////////////////////////////////////
0018 ///
0019 /// \file lambda.hpp
0020 ///
0021 /// \brief Definitions to ease the usage of Boost.Units' quantity,
0022 ///        unit, and absolute types in functors created with the
0023 ///        Boost.Lambda library.
0024 ///
0025 /// \author Torsten Maehne
0026 /// \date   2008-06-16
0027 ///
0028 /// Boost.Lambda's return type deduction system is extented to make
0029 /// use of Boost.Units' typeof_helper trait classes for Boost.Units'
0030 /// quantity, absolute, and unit template classes.
0031 ///
0032 ////////////////////////////////////////////////////////////////////////
0033 
0034 
0035 #include <boost/lambda/lambda.hpp>
0036 #include <boost/units/units_fwd.hpp>
0037 #include <boost/units/detail/dimensionless_unit.hpp>
0038 #include <boost/units/operators.hpp>
0039 
0040 namespace boost {
0041 
0042 namespace lambda {
0043 
0044     /// Partial specialization of return type trait for action
0045     /// unit<Dim, System> * Y.
0046     template<typename System, typename Dim, typename Y>
0047     struct plain_return_type_2<arithmetic_action<multiply_action>,
0048                                boost::units::unit<Dim, System>,
0049                                Y > {
0050         typedef typename boost::units::multiply_typeof_helper<
0051             boost::units::unit<Dim, System>, Y >::type type;
0052     };
0053 
0054 } // namespace lambda
0055 
0056 namespace units {
0057 
0058     template<typename System, typename Dim, typename Arg>
0059     struct multiply_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> > {
0060         typedef boost::lambda::lambda_functor<
0061           boost::lambda::lambda_functor_base<
0062               boost::lambda::arithmetic_action<boost::lambda::multiply_action>,
0063               tuple<typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type, boost::lambda::lambda_functor<Arg> >
0064           >
0065         > type;
0066     };
0067 
0068     /// Disambiguating overload for action
0069     /// unit<Dim, System> * lambda_functor<Arg>
0070     /// based on \<boost/lambda/detail/operators.hpp\>.
0071     template<typename System, typename Dim, typename Arg>
0072     inline const typename multiply_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> >::type
0073     operator*(const boost::units::unit<Dim, System>& a,
0074               const boost::lambda::lambda_functor<Arg>& b) {
0075         return typename multiply_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> >::type::inherited
0076                (tuple<typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type,
0077                       boost::lambda::lambda_functor<Arg> >
0078                      (a, b));
0079     }
0080 
0081 } // namespace units
0082 
0083 namespace lambda {
0084 
0085     /// Partial specialization of return type trait for action
0086     /// unit<Dim, System> / Y.
0087     template<typename System, typename Dim, typename Y>
0088     struct plain_return_type_2<arithmetic_action<divide_action>,
0089                                boost::units::unit<Dim, System>,
0090                                Y > {
0091         typedef typename boost::units::divide_typeof_helper<
0092             boost::units::unit<Dim, System>, Y >::type type;
0093     };
0094 
0095 } // namespace lambda
0096 
0097 namespace units {
0098 
0099     template<typename System, typename Dim, typename Arg>
0100     struct divide_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> > {
0101         typedef boost::lambda::lambda_functor<
0102           boost::lambda::lambda_functor_base<
0103             boost::lambda::arithmetic_action<boost::lambda::divide_action>,
0104               tuple<typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type, boost::lambda::lambda_functor<Arg> >
0105           >
0106         > type;
0107     };
0108 
0109     /// Disambiguating overload for action
0110     /// unit<Dim, System> / lambda_functor<Arg>
0111     /// based on \<boost/lambda/detail/operators.hpp\>.
0112     template<typename System, typename Dim, typename Arg>
0113     inline const typename divide_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> >::type
0114     operator/(const boost::units::unit<Dim, System>& a,
0115               const boost::lambda::lambda_functor<Arg>& b) {
0116         return typename divide_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> >::type::inherited
0117                (tuple<typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type,
0118                       boost::lambda::lambda_functor<Arg> >
0119                      (a, b));
0120     }
0121 
0122 } // namespace units
0123 
0124 namespace lambda {
0125 
0126     /// Partial specialization of return type trait for action
0127     /// Y * unit<Dim, System>.
0128     template<typename System, typename Dim, typename Y>
0129     struct plain_return_type_2<arithmetic_action<multiply_action>,
0130                                Y,
0131                                boost::units::unit<Dim, System> > {
0132         typedef typename boost::units::multiply_typeof_helper<
0133             Y, boost::units::unit<Dim, System> >::type type;
0134     };
0135 
0136 } // namespace lambda
0137 
0138 namespace units {
0139 
0140     template<typename System, typename Dim, typename Arg>
0141     struct multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> > {
0142         typedef boost::lambda::lambda_functor<
0143           boost::lambda::lambda_functor_base<
0144             boost::lambda::arithmetic_action<boost::lambda::multiply_action>,
0145               tuple<boost::lambda::lambda_functor<Arg>, typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type>
0146           >
0147         > type;
0148     };
0149 
0150     /// Disambiguating overload for action
0151     /// lambda_functor<Arg> * unit<Dim, System>
0152     /// based on \<boost/lambda/detail/operators.hpp\>.
0153     template<typename System, typename Dim, typename Arg>
0154     inline const typename multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> >::type
0155     operator*(const boost::lambda::lambda_functor<Arg>& a,
0156               const boost::units::unit<Dim, System>& b) {
0157         return typename multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> >::type::inherited
0158                (tuple<boost::lambda::lambda_functor<Arg>,
0159                       typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type>
0160                      (a, b));
0161     }
0162 
0163 } // namespace units
0164 
0165 namespace lambda {
0166 
0167     /// Partial specialization of return type trait for action
0168     /// Y / unit<Dim, System>.
0169     template<typename System, typename Dim, typename Y>
0170     struct plain_return_type_2<arithmetic_action<divide_action>,
0171                                Y,
0172                                boost::units::unit<Dim, System> > {
0173         typedef typename boost::units::divide_typeof_helper<
0174             Y, boost::units::unit<Dim, System> >::type type;
0175     };
0176 
0177 } // namespace lambda
0178 
0179 namespace units {
0180 
0181     template<typename System, typename Dim, typename Arg>
0182     struct divide_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> > {
0183         typedef boost::lambda::lambda_functor<
0184           boost::lambda::lambda_functor_base<
0185             boost::lambda::arithmetic_action<boost::lambda::divide_action>,
0186               tuple<boost::lambda::lambda_functor<Arg>, typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type>
0187           >
0188         > type;
0189     };
0190 
0191     /// Disambiguating overload for action
0192     /// lambda_functor<Arg> / unit<Dim, System>
0193     /// based on \<boost/lambda/detail/operators.hpp\>.
0194     template<typename System, typename Dim, typename Arg>
0195     inline const typename divide_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> >::type
0196     operator/(const boost::lambda::lambda_functor<Arg>& a,
0197               const boost::units::unit<Dim, System>& b) {
0198         return typename divide_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> >::type::inherited
0199                (tuple<boost::lambda::lambda_functor<Arg>,
0200                       typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type>
0201                      (a, b));
0202     }
0203 
0204 } // namespace units
0205 
0206 namespace lambda {
0207 
0208     /// Partial specialization of return type trait for action
0209     /// quantity<Unit, X> * X.
0210     template<typename Unit, typename X>
0211     struct plain_return_type_2<arithmetic_action<multiply_action>,
0212                                boost::units::quantity<Unit, X>,
0213                                X> {
0214         typedef typename boost::units::multiply_typeof_helper<
0215             boost::units::quantity<Unit, X>, X>::type type;
0216     };
0217 
0218     /// Partial specialization of return type trait for action
0219     /// X * quantity<Unit, X>.
0220     template<typename Unit, typename X>
0221     struct plain_return_type_2<arithmetic_action<multiply_action>,
0222                                X,
0223                                boost::units::quantity<Unit, X> > {
0224         typedef typename boost::units::multiply_typeof_helper<
0225             X, boost::units::quantity<Unit, X> >::type type;
0226     };
0227 
0228     /// Partial specialization of return type trait for action
0229     /// quantity<Unit, X> / X.
0230     template<typename Unit, typename X>
0231     struct plain_return_type_2<arithmetic_action<divide_action>,
0232                                boost::units::quantity<Unit, X>,
0233                                X> {
0234         typedef typename boost::units::divide_typeof_helper<
0235             boost::units::quantity<Unit, X>, X>::type type;
0236     };
0237 
0238     /// Partial specialization of return type trait for action
0239     /// X / quantity<Unit, X>.
0240     template<typename Unit, typename X>
0241     struct plain_return_type_2<arithmetic_action<divide_action>,
0242                                X,
0243                                boost::units::quantity<Unit, X> > {
0244         typedef typename boost::units::divide_typeof_helper<
0245             X, boost::units::quantity<Unit, X> >::type type;
0246     };
0247 
0248     /// Partial specialization of return type trait for action
0249     /// unit<Dim1, System1> * quantity<Unit2, Y>.
0250     template<typename System1, typename Dim1, typename Unit2, typename Y>
0251     struct plain_return_type_2<arithmetic_action<multiply_action>,
0252                                boost::units::unit<Dim1, System1>,
0253                                boost::units::quantity<Unit2, Y> > {
0254         typedef typename boost::units::multiply_typeof_helper<
0255             boost::units::unit<Dim1, System1>,
0256             boost::units::quantity<Unit2, Y> >::type type;
0257     };
0258 
0259     /// Partial specialization of return type trait for action
0260     /// unit<Dim1, System1> / quantity<Unit2, Y>.
0261     template<typename System1, typename Dim1, typename Unit2, typename Y>
0262     struct plain_return_type_2<arithmetic_action<divide_action>,
0263                                boost::units::unit<Dim1, System1>,
0264                                boost::units::quantity<Unit2, Y> > {
0265         typedef typename boost::units::divide_typeof_helper<
0266             boost::units::unit<Dim1, System1>,
0267             boost::units::quantity<Unit2, Y> >::type type;
0268     };
0269 
0270     /// Partial specialization of return type trait for action
0271     /// quantity<Unit1, Y> * unit<Dim2, System2>.
0272     template<typename Unit1, typename Y, typename System2, typename Dim2>
0273     struct plain_return_type_2<arithmetic_action<multiply_action>,
0274                                boost::units::quantity<Unit1, Y>,
0275                                boost::units::unit<Dim2, System2> > {
0276         typedef typename boost::units::multiply_typeof_helper<
0277             boost::units::quantity<Unit1, Y>,
0278             boost::units::unit<Dim2, System2> >::type type;
0279     };
0280 
0281     /// Partial specialization of return type trait for action
0282     /// quantity<Unit1, Y> / unit<Dim2, System2>.
0283     template<typename Unit1, typename Y, typename System2, typename Dim2>
0284     struct plain_return_type_2<arithmetic_action<divide_action>,
0285                                boost::units::quantity<Unit1, Y>,
0286                                boost::units::unit<Dim2, System2> > {
0287         typedef typename boost::units::divide_typeof_helper<
0288             boost::units::quantity<Unit1, Y>,
0289             boost::units::unit<Dim2, System2> >::type type;
0290     };
0291 
0292     /// Partial specialization of return type trait for action
0293     /// +quantity<Unit, Y>.
0294     template<typename Unit, typename Y>
0295     struct plain_return_type_1<unary_arithmetic_action<plus_action>,
0296                                boost::units::quantity<Unit, Y> > {
0297         typedef typename boost::units::unary_plus_typeof_helper<
0298             boost::units::quantity<Unit, Y> >::type type;
0299     };
0300 
0301     /// Partial specialization of return type trait for action
0302     /// -quantity<Unit, Y>.
0303     template<typename Unit, typename Y>
0304     struct plain_return_type_1<unary_arithmetic_action<minus_action>,
0305                                boost::units::quantity<Unit, Y> > {
0306         typedef typename boost::units::unary_minus_typeof_helper<
0307             boost::units::quantity<Unit, Y> >::type type;
0308     };
0309 
0310     /// Partial specialization of return type trait for action
0311     /// quantity<Unit1, X> + quantity<Unit2, Y>.
0312     template<typename Unit1, typename X, typename Unit2, typename Y>
0313     struct plain_return_type_2<arithmetic_action<plus_action>,
0314                                boost::units::quantity<Unit1, X>,
0315                                boost::units::quantity<Unit2, Y> > {
0316         typedef typename boost::units::add_typeof_helper<
0317             boost::units::quantity<Unit1, X>,
0318             boost::units::quantity<Unit2, Y> >::type type;
0319     };
0320 
0321     /// Partial specialization of return type trait for action
0322     /// quantity<dimensionless, X> + Y.
0323     template<typename System, typename X, typename Y>
0324     struct plain_return_type_2<arithmetic_action<plus_action>,
0325                                boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), X>,
0326                                Y> {
0327         typedef typename boost::units::add_typeof_helper<
0328             boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), X>,
0329             Y>::type type;
0330     };
0331 
0332     /// Partial specialization of return type trait for action
0333     /// X + quantity<dimensionless, Y>.
0334     template<typename System, typename X, typename Y>
0335     struct plain_return_type_2<arithmetic_action<plus_action>,
0336                                X,
0337                                boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y> > {
0338         typedef typename boost::units::add_typeof_helper<
0339             X,
0340             boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y> >::type type;
0341     };
0342 
0343     /// Partial specialization of return type trait for action
0344     /// quantity<Unit1, X> - quantity<Unit2, Y>.
0345     template<typename Unit1, typename X, typename Unit2, typename Y>
0346     struct plain_return_type_2<arithmetic_action<minus_action>,
0347                                boost::units::quantity<Unit1, X>,
0348                                boost::units::quantity<Unit2, Y> > {
0349         typedef typename boost::units::subtract_typeof_helper<
0350             boost::units::quantity<Unit1, X>,
0351             boost::units::quantity<Unit2, Y> >::type type;
0352     };
0353 
0354     /// Partial specialization of return type trait for action
0355     /// quantity<dimensionless, X> - Y.
0356     template<typename System, typename X, typename Y>
0357     struct plain_return_type_2<arithmetic_action<minus_action>,
0358                                boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), X>,
0359                                Y> {
0360         typedef typename boost::units::subtract_typeof_helper<
0361             boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), X>,
0362             Y>::type type;
0363     };
0364 
0365     /// Partial specialization of return type trait for action
0366     /// X - quantity<dimensionless, Y>.
0367     template<typename System, typename X, typename Y>
0368     struct plain_return_type_2<arithmetic_action<minus_action>,
0369                                X,
0370                                boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y> > {
0371         typedef typename boost::units::subtract_typeof_helper<
0372             X,
0373             boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y> >::type type;
0374     };
0375 
0376     /// Partial specialization of return type trait for action
0377     /// quantity<Unit1, X> * quantity<Unit2, Y>.
0378     template<typename Unit1, typename X, typename Unit2, typename Y>
0379     struct plain_return_type_2<arithmetic_action<multiply_action>,
0380                                boost::units::quantity<Unit1, X>,
0381                                boost::units::quantity<Unit2, Y> > {
0382         typedef typename boost::units::multiply_typeof_helper<
0383             boost::units::quantity<Unit1, X>,
0384             boost::units::quantity<Unit2, Y> >::type type;
0385     };
0386 
0387     /// Partial specialization of return type trait for action
0388     /// quantity<Unit1, X> / quantity<Unit2, Y>.
0389     template<typename Unit1, typename X, typename Unit2, typename Y>
0390     struct plain_return_type_2<arithmetic_action<divide_action>,
0391                                boost::units::quantity<Unit1, X>,
0392                                boost::units::quantity<Unit2, Y> > {
0393         typedef typename boost::units::divide_typeof_helper<
0394             boost::units::quantity<Unit1, X>,
0395             boost::units::quantity<Unit2, Y> >::type type;
0396     };
0397 
0398 
0399     ////////////////////////////////////////////////////////////////////////
0400     // Partial specialization of Boost.Lambda's trait classes for all
0401     // operators overloaded in <boost/units/unit.hpp>
0402     ////////////////////////////////////////////////////////////////////////
0403 
0404     /// Partial specialization of return type trait for action
0405     /// +unit<Dim, System>.
0406     template<typename Dim, typename System>
0407     struct plain_return_type_1<unary_arithmetic_action<plus_action>,
0408                                boost::units::unit<Dim, System> > {
0409         typedef typename boost::units::unary_plus_typeof_helper<
0410             boost::units::unit<Dim, System> >::type type;
0411     };
0412 
0413     /// Partial specialization of return type trait for action
0414     /// -unit<Dim, System>.
0415     template<typename Dim, typename System>
0416     struct plain_return_type_1<unary_arithmetic_action<minus_action>,
0417                                boost::units::unit<Dim, System> > {
0418         typedef typename boost::units::unary_minus_typeof_helper<
0419             boost::units::unit<Dim, System> >::type type;
0420     };
0421 
0422     /// Partial specialization of return type trait for action
0423     /// unit<Dim1, System1> + unit<Dim2, System2>.
0424     template<typename Dim1, typename Dim2, typename System1, typename System2>
0425     struct plain_return_type_2<arithmetic_action<plus_action>,
0426                                boost::units::unit<Dim1, System1>,
0427                                boost::units::unit<Dim2, System2> > {
0428         typedef typename boost::units::add_typeof_helper<
0429             boost::units::unit<Dim1, System1>,
0430             boost::units::unit<Dim2, System2> >::type type;
0431     };
0432 
0433     /// Partial specialization of return type trait for action
0434     /// unit<Dim1, System1> - unit<Dim2, System2>.
0435     template<typename Dim1, typename Dim2, typename System1, typename System2>
0436     struct plain_return_type_2<arithmetic_action<minus_action>,
0437                                boost::units::unit<Dim1, System1>,
0438                                boost::units::unit<Dim2, System2> > {
0439         typedef typename boost::units::subtract_typeof_helper<
0440             boost::units::unit<Dim1, System1>,
0441             boost::units::unit<Dim2, System2> >::type type;
0442     };
0443 
0444     /// Partial specialization of return type trait for action
0445     /// unit<Dim1, System1> * unit<Dim2, System2>.
0446     template<typename Dim1, typename Dim2, typename System1, typename System2>
0447     struct plain_return_type_2<arithmetic_action<multiply_action>,
0448                                boost::units::unit<Dim1, System1>,
0449                                boost::units::unit<Dim2, System2> > {
0450         typedef typename boost::units::multiply_typeof_helper<
0451             boost::units::unit<Dim1, System1>,
0452             boost::units::unit<Dim2, System2> >::type type;
0453     };
0454 
0455     /// Partial specialization of return type trait for action
0456     /// unit<Dim1, System1> / unit<Dim2, System2>.
0457     template<typename Dim1, typename Dim2, typename System1, typename System2>
0458     struct plain_return_type_2<arithmetic_action<divide_action>,
0459                                boost::units::unit<Dim1, System1>,
0460                                boost::units::unit<Dim2, System2> > {
0461         typedef typename boost::units::divide_typeof_helper<
0462             boost::units::unit<Dim1, System1>,
0463             boost::units::unit<Dim2, System2> >::type type;
0464     };
0465 
0466 
0467     ////////////////////////////////////////////////////////////////////////
0468     // Partial specialization of Boost.Lambda's trait classes for all
0469     // operators overloaded in <boost/units/absolute.hpp>
0470     ////////////////////////////////////////////////////////////////////////
0471 
0472 
0473     /// Partial specialization of return type trait for action
0474     /// absolute<Y> + Y.
0475     template<typename Y>
0476     struct plain_return_type_2<arithmetic_action<plus_action>,
0477                                boost::units::absolute<Y>,
0478                                Y> {
0479         typedef typename boost::units::absolute<Y> type;
0480     };
0481 
0482     /// Partial specialization of return type trait for action
0483     /// Y + absolute<Y>.
0484     template<typename Y>
0485     struct plain_return_type_2<arithmetic_action<plus_action>,
0486                                Y,
0487                                boost::units::absolute<Y> > {
0488         typedef typename boost::units::absolute<Y> type;
0489     };
0490 
0491     /// Partial specialization of return type trait for action
0492     /// absolute<Y> - Y.
0493     template<typename Y>
0494     struct plain_return_type_2<arithmetic_action<minus_action>,
0495                                boost::units::absolute<Y>,
0496                                Y> {
0497         typedef typename boost::units::absolute<Y> type;
0498     };
0499 
0500     /// Partial specialization of return type trait for action
0501     /// absolute<Y> - absolute<Y>.
0502     template<typename Y>
0503     struct plain_return_type_2<arithmetic_action<minus_action>,
0504                                boost::units::absolute<Y>,
0505                                boost::units::absolute<Y> > {
0506         typedef Y type;
0507     };
0508 
0509     /// Partial specialization of return type trait for action
0510     /// T * absolute<unit<D, S> >.
0511     template<typename D, typename S, typename T>
0512     struct plain_return_type_2<arithmetic_action<multiply_action>,
0513                                T,
0514                                boost::units::absolute<boost::units::unit<D, S> > > {
0515         typedef typename boost::units::quantity<
0516             boost::units::absolute<boost::units::unit<D, S> >, T> type;
0517     };
0518 
0519 } // namespace lambda
0520 
0521 namespace units {
0522     
0523     template<typename System, typename Dim, typename Arg>
0524     struct multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::absolute<boost::units::unit<Dim, System> > > {
0525         typedef boost::lambda::lambda_functor<
0526           boost::lambda::lambda_functor_base<
0527             boost::lambda::arithmetic_action<boost::lambda::multiply_action>,
0528               tuple<boost::lambda::lambda_functor<Arg>,
0529                     typename boost::lambda::const_copy_argument<const boost::units::absolute<boost::units::unit<Dim, System> > >::type>
0530           >
0531         > type;
0532     };
0533 
0534     /// Disambiguating overload for action
0535     /// lambda_functor<Arg> * absolute<unit<Dim, System> >
0536     /// based on \<boost/lambda/detail/operators.hpp\>.
0537     template<typename System, typename Dim, typename Arg>
0538     inline const typename multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::absolute<boost::units::unit<Dim, System> > >::type
0539     operator*(const boost::lambda::lambda_functor<Arg>& a,
0540               const boost::units::absolute<boost::units::unit<Dim, System> >& b) {
0541         return typename multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::absolute<boost::units::unit<Dim, System> > >::type::inherited
0542                (tuple<boost::lambda::lambda_functor<Arg>,
0543                       typename boost::lambda::const_copy_argument<const boost::units::absolute<boost::units::unit<Dim, System> > >::type>
0544                      (a, b));
0545     }
0546 
0547 } // namespace units
0548 
0549 namespace lambda {
0550 
0551     /// Partial specialization of return type trait for action
0552     /// absolute<unit<D, S> > * T.
0553     template<typename D, typename S, typename T>
0554     struct plain_return_type_2<arithmetic_action<multiply_action>,
0555                                boost::units::absolute<boost::units::unit<D, S> >,
0556                                T> {
0557         typedef typename boost::units::quantity<
0558             boost::units::absolute<boost::units::unit<D, S> >, T> type;
0559     };
0560 
0561 } // namespace lambda
0562 
0563 namespace units {
0564     
0565     template<typename System, typename Dim, typename Arg>
0566     struct multiply_typeof_helper<boost::units::absolute<boost::units::unit<Dim, System> >, boost::lambda::lambda_functor<Arg> > {
0567         typedef boost::lambda::lambda_functor<
0568           boost::lambda::lambda_functor_base<
0569             boost::lambda::arithmetic_action<boost::lambda::multiply_action>,
0570               tuple<typename boost::lambda::const_copy_argument<const boost::units::absolute<boost::units::unit<Dim, System> > >::type,
0571                     boost::lambda::lambda_functor<Arg> >
0572           >
0573         > type;
0574     };
0575 
0576     /// Disambiguating overload for action
0577     /// absolute<unit<Dim, System> > * lambda_functor<Arg>
0578     /// based on \<boost/lambda/detail/operators.hpp\>.
0579     template<typename System, typename Dim, typename Arg>
0580     inline const typename multiply_typeof_helper<boost::units::absolute<boost::units::unit<Dim, System> >, boost::lambda::lambda_functor<Arg> >::type
0581     operator*(const boost::units::absolute<boost::units::unit<Dim, System> >& a,
0582               const boost::lambda::lambda_functor<Arg>& b) {
0583         return typename multiply_typeof_helper<boost::units::absolute<boost::units::unit<Dim, System> >, boost::lambda::lambda_functor<Arg> >::type::inherited
0584                (tuple<typename boost::lambda::const_copy_argument<const boost::units::absolute<boost::units::unit<Dim, System> > >::type,
0585                       boost::lambda::lambda_functor<Arg> >
0586                      (a, b));
0587     }
0588 
0589 } // namespace units
0590 
0591 } // namespace boost
0592 
0593 #endif // BOOST_UNITS_LAMBDA_HPP