123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593 |
- #ifndef BOOST_UNITS_LAMBDA_HPP
- #define BOOST_UNITS_LAMBDA_HPP
- #include <boost/lambda/lambda.hpp>
- #include <boost/units/units_fwd.hpp>
- #include <boost/units/detail/dimensionless_unit.hpp>
- #include <boost/units/operators.hpp>
- namespace boost {
- namespace lambda {
-
-
- template<typename System, typename Dim, typename Y>
- struct plain_return_type_2<arithmetic_action<multiply_action>,
- boost::units::unit<Dim, System>,
- Y > {
- typedef typename boost::units::multiply_typeof_helper<
- boost::units::unit<Dim, System>, Y >::type type;
- };
- }
- namespace units {
- template<typename System, typename Dim, typename Arg>
- struct multiply_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> > {
- typedef boost::lambda::lambda_functor<
- boost::lambda::lambda_functor_base<
- boost::lambda::arithmetic_action<boost::lambda::multiply_action>,
- tuple<typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type, boost::lambda::lambda_functor<Arg> >
- >
- > type;
- };
-
-
-
- template<typename System, typename Dim, typename Arg>
- inline const typename multiply_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> >::type
- operator*(const boost::units::unit<Dim, System>& a,
- const boost::lambda::lambda_functor<Arg>& b) {
- return typename multiply_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> >::type::inherited
- (tuple<typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type,
- boost::lambda::lambda_functor<Arg> >
- (a, b));
- }
- }
- namespace lambda {
-
-
- template<typename System, typename Dim, typename Y>
- struct plain_return_type_2<arithmetic_action<divide_action>,
- boost::units::unit<Dim, System>,
- Y > {
- typedef typename boost::units::divide_typeof_helper<
- boost::units::unit<Dim, System>, Y >::type type;
- };
- }
- namespace units {
- template<typename System, typename Dim, typename Arg>
- struct divide_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> > {
- typedef boost::lambda::lambda_functor<
- boost::lambda::lambda_functor_base<
- boost::lambda::arithmetic_action<boost::lambda::divide_action>,
- tuple<typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type, boost::lambda::lambda_functor<Arg> >
- >
- > type;
- };
-
-
-
- template<typename System, typename Dim, typename Arg>
- inline const typename divide_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> >::type
- operator/(const boost::units::unit<Dim, System>& a,
- const boost::lambda::lambda_functor<Arg>& b) {
- return typename divide_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> >::type::inherited
- (tuple<typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type,
- boost::lambda::lambda_functor<Arg> >
- (a, b));
- }
- }
- namespace lambda {
-
-
- template<typename System, typename Dim, typename Y>
- struct plain_return_type_2<arithmetic_action<multiply_action>,
- Y,
- boost::units::unit<Dim, System> > {
- typedef typename boost::units::multiply_typeof_helper<
- Y, boost::units::unit<Dim, System> >::type type;
- };
- }
- namespace units {
- template<typename System, typename Dim, typename Arg>
- struct multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> > {
- typedef boost::lambda::lambda_functor<
- boost::lambda::lambda_functor_base<
- boost::lambda::arithmetic_action<boost::lambda::multiply_action>,
- tuple<boost::lambda::lambda_functor<Arg>, typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type>
- >
- > type;
- };
-
-
-
- template<typename System, typename Dim, typename Arg>
- inline const typename multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> >::type
- operator*(const boost::lambda::lambda_functor<Arg>& a,
- const boost::units::unit<Dim, System>& b) {
- return typename multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> >::type::inherited
- (tuple<boost::lambda::lambda_functor<Arg>,
- typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type>
- (a, b));
- }
- }
- namespace lambda {
-
-
- template<typename System, typename Dim, typename Y>
- struct plain_return_type_2<arithmetic_action<divide_action>,
- Y,
- boost::units::unit<Dim, System> > {
- typedef typename boost::units::divide_typeof_helper<
- Y, boost::units::unit<Dim, System> >::type type;
- };
- }
- namespace units {
- template<typename System, typename Dim, typename Arg>
- struct divide_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> > {
- typedef boost::lambda::lambda_functor<
- boost::lambda::lambda_functor_base<
- boost::lambda::arithmetic_action<boost::lambda::divide_action>,
- tuple<boost::lambda::lambda_functor<Arg>, typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type>
- >
- > type;
- };
-
-
-
- template<typename System, typename Dim, typename Arg>
- inline const typename divide_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> >::type
- operator/(const boost::lambda::lambda_functor<Arg>& a,
- const boost::units::unit<Dim, System>& b) {
- return typename divide_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> >::type::inherited
- (tuple<boost::lambda::lambda_functor<Arg>,
- typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type>
- (a, b));
- }
- }
- namespace lambda {
-
-
- template<typename Unit, typename X>
- struct plain_return_type_2<arithmetic_action<multiply_action>,
- boost::units::quantity<Unit, X>,
- X> {
- typedef typename boost::units::multiply_typeof_helper<
- boost::units::quantity<Unit, X>, X>::type type;
- };
-
-
- template<typename Unit, typename X>
- struct plain_return_type_2<arithmetic_action<multiply_action>,
- X,
- boost::units::quantity<Unit, X> > {
- typedef typename boost::units::multiply_typeof_helper<
- X, boost::units::quantity<Unit, X> >::type type;
- };
-
-
- template<typename Unit, typename X>
- struct plain_return_type_2<arithmetic_action<divide_action>,
- boost::units::quantity<Unit, X>,
- X> {
- typedef typename boost::units::divide_typeof_helper<
- boost::units::quantity<Unit, X>, X>::type type;
- };
-
-
- template<typename Unit, typename X>
- struct plain_return_type_2<arithmetic_action<divide_action>,
- X,
- boost::units::quantity<Unit, X> > {
- typedef typename boost::units::divide_typeof_helper<
- X, boost::units::quantity<Unit, X> >::type type;
- };
-
-
- template<typename System1, typename Dim1, typename Unit2, typename Y>
- struct plain_return_type_2<arithmetic_action<multiply_action>,
- boost::units::unit<Dim1, System1>,
- boost::units::quantity<Unit2, Y> > {
- typedef typename boost::units::multiply_typeof_helper<
- boost::units::unit<Dim1, System1>,
- boost::units::quantity<Unit2, Y> >::type type;
- };
-
-
- template<typename System1, typename Dim1, typename Unit2, typename Y>
- struct plain_return_type_2<arithmetic_action<divide_action>,
- boost::units::unit<Dim1, System1>,
- boost::units::quantity<Unit2, Y> > {
- typedef typename boost::units::divide_typeof_helper<
- boost::units::unit<Dim1, System1>,
- boost::units::quantity<Unit2, Y> >::type type;
- };
-
-
- template<typename Unit1, typename Y, typename System2, typename Dim2>
- struct plain_return_type_2<arithmetic_action<multiply_action>,
- boost::units::quantity<Unit1, Y>,
- boost::units::unit<Dim2, System2> > {
- typedef typename boost::units::multiply_typeof_helper<
- boost::units::quantity<Unit1, Y>,
- boost::units::unit<Dim2, System2> >::type type;
- };
-
-
- template<typename Unit1, typename Y, typename System2, typename Dim2>
- struct plain_return_type_2<arithmetic_action<divide_action>,
- boost::units::quantity<Unit1, Y>,
- boost::units::unit<Dim2, System2> > {
- typedef typename boost::units::divide_typeof_helper<
- boost::units::quantity<Unit1, Y>,
- boost::units::unit<Dim2, System2> >::type type;
- };
-
-
- template<typename Unit, typename Y>
- struct plain_return_type_1<unary_arithmetic_action<plus_action>,
- boost::units::quantity<Unit, Y> > {
- typedef typename boost::units::unary_plus_typeof_helper<
- boost::units::quantity<Unit, Y> >::type type;
- };
-
-
- template<typename Unit, typename Y>
- struct plain_return_type_1<unary_arithmetic_action<minus_action>,
- boost::units::quantity<Unit, Y> > {
- typedef typename boost::units::unary_minus_typeof_helper<
- boost::units::quantity<Unit, Y> >::type type;
- };
-
-
- template<typename Unit1, typename X, typename Unit2, typename Y>
- struct plain_return_type_2<arithmetic_action<plus_action>,
- boost::units::quantity<Unit1, X>,
- boost::units::quantity<Unit2, Y> > {
- typedef typename boost::units::add_typeof_helper<
- boost::units::quantity<Unit1, X>,
- boost::units::quantity<Unit2, Y> >::type type;
- };
-
-
- template<typename System, typename X, typename Y>
- struct plain_return_type_2<arithmetic_action<plus_action>,
- boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), X>,
- Y> {
- typedef typename boost::units::add_typeof_helper<
- boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), X>,
- Y>::type type;
- };
-
-
- template<typename System, typename X, typename Y>
- struct plain_return_type_2<arithmetic_action<plus_action>,
- X,
- boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y> > {
- typedef typename boost::units::add_typeof_helper<
- X,
- boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y> >::type type;
- };
-
-
- template<typename Unit1, typename X, typename Unit2, typename Y>
- struct plain_return_type_2<arithmetic_action<minus_action>,
- boost::units::quantity<Unit1, X>,
- boost::units::quantity<Unit2, Y> > {
- typedef typename boost::units::subtract_typeof_helper<
- boost::units::quantity<Unit1, X>,
- boost::units::quantity<Unit2, Y> >::type type;
- };
-
-
- template<typename System, typename X, typename Y>
- struct plain_return_type_2<arithmetic_action<minus_action>,
- boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), X>,
- Y> {
- typedef typename boost::units::subtract_typeof_helper<
- boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), X>,
- Y>::type type;
- };
-
-
- template<typename System, typename X, typename Y>
- struct plain_return_type_2<arithmetic_action<minus_action>,
- X,
- boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y> > {
- typedef typename boost::units::subtract_typeof_helper<
- X,
- boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y> >::type type;
- };
-
-
- template<typename Unit1, typename X, typename Unit2, typename Y>
- struct plain_return_type_2<arithmetic_action<multiply_action>,
- boost::units::quantity<Unit1, X>,
- boost::units::quantity<Unit2, Y> > {
- typedef typename boost::units::multiply_typeof_helper<
- boost::units::quantity<Unit1, X>,
- boost::units::quantity<Unit2, Y> >::type type;
- };
-
-
- template<typename Unit1, typename X, typename Unit2, typename Y>
- struct plain_return_type_2<arithmetic_action<divide_action>,
- boost::units::quantity<Unit1, X>,
- boost::units::quantity<Unit2, Y> > {
- typedef typename boost::units::divide_typeof_helper<
- boost::units::quantity<Unit1, X>,
- boost::units::quantity<Unit2, Y> >::type type;
- };
-
-
-
-
-
-
- template<typename Dim, typename System>
- struct plain_return_type_1<unary_arithmetic_action<plus_action>,
- boost::units::unit<Dim, System> > {
- typedef typename boost::units::unary_plus_typeof_helper<
- boost::units::unit<Dim, System> >::type type;
- };
-
-
- template<typename Dim, typename System>
- struct plain_return_type_1<unary_arithmetic_action<minus_action>,
- boost::units::unit<Dim, System> > {
- typedef typename boost::units::unary_minus_typeof_helper<
- boost::units::unit<Dim, System> >::type type;
- };
-
-
- template<typename Dim1, typename Dim2, typename System1, typename System2>
- struct plain_return_type_2<arithmetic_action<plus_action>,
- boost::units::unit<Dim1, System1>,
- boost::units::unit<Dim2, System2> > {
- typedef typename boost::units::add_typeof_helper<
- boost::units::unit<Dim1, System1>,
- boost::units::unit<Dim2, System2> >::type type;
- };
-
-
- template<typename Dim1, typename Dim2, typename System1, typename System2>
- struct plain_return_type_2<arithmetic_action<minus_action>,
- boost::units::unit<Dim1, System1>,
- boost::units::unit<Dim2, System2> > {
- typedef typename boost::units::subtract_typeof_helper<
- boost::units::unit<Dim1, System1>,
- boost::units::unit<Dim2, System2> >::type type;
- };
-
-
- template<typename Dim1, typename Dim2, typename System1, typename System2>
- struct plain_return_type_2<arithmetic_action<multiply_action>,
- boost::units::unit<Dim1, System1>,
- boost::units::unit<Dim2, System2> > {
- typedef typename boost::units::multiply_typeof_helper<
- boost::units::unit<Dim1, System1>,
- boost::units::unit<Dim2, System2> >::type type;
- };
-
-
- template<typename Dim1, typename Dim2, typename System1, typename System2>
- struct plain_return_type_2<arithmetic_action<divide_action>,
- boost::units::unit<Dim1, System1>,
- boost::units::unit<Dim2, System2> > {
- typedef typename boost::units::divide_typeof_helper<
- boost::units::unit<Dim1, System1>,
- boost::units::unit<Dim2, System2> >::type type;
- };
-
-
-
-
-
-
- template<typename Y>
- struct plain_return_type_2<arithmetic_action<plus_action>,
- boost::units::absolute<Y>,
- Y> {
- typedef typename boost::units::absolute<Y> type;
- };
-
-
- template<typename Y>
- struct plain_return_type_2<arithmetic_action<plus_action>,
- Y,
- boost::units::absolute<Y> > {
- typedef typename boost::units::absolute<Y> type;
- };
-
-
- template<typename Y>
- struct plain_return_type_2<arithmetic_action<minus_action>,
- boost::units::absolute<Y>,
- Y> {
- typedef typename boost::units::absolute<Y> type;
- };
-
-
- template<typename Y>
- struct plain_return_type_2<arithmetic_action<minus_action>,
- boost::units::absolute<Y>,
- boost::units::absolute<Y> > {
- typedef Y type;
- };
-
-
- template<typename D, typename S, typename T>
- struct plain_return_type_2<arithmetic_action<multiply_action>,
- T,
- boost::units::absolute<boost::units::unit<D, S> > > {
- typedef typename boost::units::quantity<
- boost::units::absolute<boost::units::unit<D, S> >, T> type;
- };
- }
- namespace units {
-
- template<typename System, typename Dim, typename Arg>
- struct multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::absolute<boost::units::unit<Dim, System> > > {
- typedef boost::lambda::lambda_functor<
- boost::lambda::lambda_functor_base<
- boost::lambda::arithmetic_action<boost::lambda::multiply_action>,
- tuple<boost::lambda::lambda_functor<Arg>,
- typename boost::lambda::const_copy_argument<const boost::units::absolute<boost::units::unit<Dim, System> > >::type>
- >
- > type;
- };
-
-
-
- template<typename System, typename Dim, typename Arg>
- inline const typename multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::absolute<boost::units::unit<Dim, System> > >::type
- operator*(const boost::lambda::lambda_functor<Arg>& a,
- const boost::units::absolute<boost::units::unit<Dim, System> >& b) {
- return typename multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::absolute<boost::units::unit<Dim, System> > >::type::inherited
- (tuple<boost::lambda::lambda_functor<Arg>,
- typename boost::lambda::const_copy_argument<const boost::units::absolute<boost::units::unit<Dim, System> > >::type>
- (a, b));
- }
- }
- namespace lambda {
-
-
- template<typename D, typename S, typename T>
- struct plain_return_type_2<arithmetic_action<multiply_action>,
- boost::units::absolute<boost::units::unit<D, S> >,
- T> {
- typedef typename boost::units::quantity<
- boost::units::absolute<boost::units::unit<D, S> >, T> type;
- };
- }
- namespace units {
-
- template<typename System, typename Dim, typename Arg>
- struct multiply_typeof_helper<boost::units::absolute<boost::units::unit<Dim, System> >, boost::lambda::lambda_functor<Arg> > {
- typedef boost::lambda::lambda_functor<
- boost::lambda::lambda_functor_base<
- boost::lambda::arithmetic_action<boost::lambda::multiply_action>,
- tuple<typename boost::lambda::const_copy_argument<const boost::units::absolute<boost::units::unit<Dim, System> > >::type,
- boost::lambda::lambda_functor<Arg> >
- >
- > type;
- };
-
-
-
- template<typename System, typename Dim, typename Arg>
- inline const typename multiply_typeof_helper<boost::units::absolute<boost::units::unit<Dim, System> >, boost::lambda::lambda_functor<Arg> >::type
- operator*(const boost::units::absolute<boost::units::unit<Dim, System> >& a,
- const boost::lambda::lambda_functor<Arg>& b) {
- return typename multiply_typeof_helper<boost::units::absolute<boost::units::unit<Dim, System> >, boost::lambda::lambda_functor<Arg> >::type::inherited
- (tuple<typename boost::lambda::const_copy_argument<const boost::units::absolute<boost::units::unit<Dim, System> > >::type,
- boost::lambda::lambda_functor<Arg> >
- (a, b));
- }
- }
- }
- #endif
|