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
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef BOOST_UNITS_LAMBDA_HPP
0014 #define BOOST_UNITS_LAMBDA_HPP
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
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
0045
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 }
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
0069
0070
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 }
0082
0083 namespace lambda {
0084
0085
0086
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 }
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
0110
0111
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 }
0123
0124 namespace lambda {
0125
0126
0127
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 }
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
0151
0152
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 }
0164
0165 namespace lambda {
0166
0167
0168
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 }
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
0192
0193
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 }
0205
0206 namespace lambda {
0207
0208
0209
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
0219
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
0229
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
0239
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
0249
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
0260
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
0271
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
0282
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
0293
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
0302
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
0311
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
0322
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
0333
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
0344
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
0355
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
0366
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
0377
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
0388
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
0401
0402
0403
0404
0405
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
0414
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
0423
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
0434
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
0445
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
0456
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
0469
0470
0471
0472
0473
0474
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
0483
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
0492
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
0501
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
0510
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 }
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
0535
0536
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 }
0548
0549 namespace lambda {
0550
0551
0552
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 }
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
0577
0578
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 }
0590
0591 }
0592
0593 #endif