1 #ifndef PIXLED_FUNCTIONNAL_COMPARISONS_H
2 #define PIXLED_FUNCTIONNAL_COMPARISONS_H
4 #include "../function.h"
8 namespace conditional {
38 if(this->
template call<0>(l, t))
39 return this->
template call<1>(l, t);
41 return this->
template call<2>(l, t);
55 template<
typename P1,
typename P2>
61 return this->
template call<0>(l, t) == this->
template call<1>(l, t);
79 template<
typename Arg1,
typename Arg2,
80 typename std::enable_if<
86 typename std::remove_reference<Arg1>::type::Type,
88 typename std::remove_reference<Arg2>::type::Type
90 return {std::forward<Arg1>(f1), std::forward<Arg2>(f2)};
107 template<
typename Arg1,
typename Arg2,
108 typename std::enable_if<
111 ,
bool>::type =
true>
114 typename std::remove_reference<Arg1>::type::Type,
116 typename std::remove_reference<Arg2>::type
118 return {std::forward<Arg1>(f1), std::forward<Arg2>(c2)};
135 template<
typename Arg1,
typename Arg2,
136 typename std::enable_if<
139 ,
bool>::type =
true>
142 typename std::remove_reference<Arg1>::type,
144 typename std::remove_reference<Arg2>::type::Type
146 return {std::forward<Arg1>(c1), std::forward<Arg2>(f2)};
149 namespace conditional {
160 template<
typename P1,
typename P2>
166 return this->
template call<0>(l, t) != this->
template call<1>(l, t);
184 template<
typename Arg1,
typename Arg2,
185 typename std::enable_if<
188 ,
bool>::type =
true>
189 conditional::NotEqual<
191 typename std::remove_reference<Arg1>::type::Type,
193 typename std::remove_reference<Arg2>::type::Type
195 return {std::forward<Arg1>(f1), std::forward<Arg2>(f2)};
212 template<
typename Arg1,
typename Arg2,
213 typename std::enable_if<
216 ,
bool>::type =
true>
217 conditional::NotEqual<
219 typename std::remove_reference<Arg1>::type::Type,
221 typename std::remove_reference<Arg2>::type
223 return {std::forward<Arg1>(f1), std::forward<Arg2>(c2)};
240 template<
typename Arg1,
typename Arg2,
241 typename std::enable_if<
244 ,
bool>::type =
true>
245 conditional::NotEqual<
247 typename std::remove_reference<Arg1>::type,
249 typename std::remove_reference<Arg2>::type::Type
251 return {std::forward<Arg1>(c1), std::forward<Arg2>(f2)};
254 namespace conditional {
265 template<
typename P1,
typename P2>
271 return this->
template call<0>(l, t) < this->
template call<1>(l, t);
289 template<
typename Arg1,
typename Arg2,
290 typename std::enable_if<
293 ,
bool>::type =
true>
294 conditional::LessThan<
296 typename std::remove_reference<Arg1>::type::Type,
298 typename std::remove_reference<Arg2>::type::Type
300 return {std::forward<Arg1>(f1), std::forward<Arg2>(f2)};
317 template<
typename Arg1,
typename Arg2,
318 typename std::enable_if<
321 ,
bool>::type =
true>
322 conditional::LessThan<
324 typename std::remove_reference<Arg1>::type::Type,
326 typename std::remove_reference<Arg2>::type
328 return {std::forward<Arg1>(f1), std::forward<Arg2>(c2)};
345 template<
typename Arg1,
typename Arg2,
346 typename std::enable_if<
349 ,
bool>::type =
true>
350 conditional::LessThan<
352 typename std::remove_reference<Arg1>::type,
354 typename std::remove_reference<Arg2>::type::Type
356 return {std::forward<Arg1>(c1), std::forward<Arg2>(f2)};
359 namespace conditional {
370 template<
typename P1,
typename P2>
376 return this->
template call<0>(l, t) <= this->
template call<1>(l, t);
394 template<
typename Arg1,
typename Arg2,
395 typename std::enable_if<
398 ,
bool>::type =
true>
399 conditional::LessThanOrEqual<
401 typename std::remove_reference<Arg1>::type::Type,
403 typename std::remove_reference<Arg2>::type::Type
405 return {std::forward<Arg1>(f1), std::forward<Arg2>(f2)};
422 template<
typename Arg1,
typename Arg2,
423 typename std::enable_if<
426 ,
bool>::type =
true>
427 conditional::LessThanOrEqual<
429 typename std::remove_reference<Arg1>::type::Type,
431 typename std::remove_reference<Arg2>::type
433 return {std::forward<Arg1>(f1), std::forward<Arg2>(c2)};
450 template<
typename Arg1,
typename Arg2,
451 typename std::enable_if<
454 ,
bool>::type =
true>
455 conditional::LessThanOrEqual<
457 typename std::remove_reference<Arg1>::type,
459 typename std::remove_reference<Arg2>::type::Type
461 return {std::forward<Arg1>(c1), std::forward<Arg2>(f2)};
464 namespace conditional {
475 template<
typename P1,
typename P2>
481 return this->
template call<0>(l, t) > this->
template call<1>(l, t);
499 template<
typename Arg1,
typename Arg2,
500 typename std::enable_if<
503 ,
bool>::type =
true>
504 conditional::GreaterThan<
506 typename std::remove_reference<Arg1>::type::Type,
508 typename std::remove_reference<Arg2>::type::Type
510 return {std::forward<Arg1>(f1), std::forward<Arg2>(f2)};
527 template<
typename Arg1,
typename Arg2,
528 typename std::enable_if<
531 ,
bool>::type =
true>
532 conditional::GreaterThan<
534 typename std::remove_reference<Arg1>::type::Type,
536 typename std::remove_reference<Arg2>::type
538 return {std::forward<Arg1>(f1), std::forward<Arg2>(c2)};
555 template<
typename Arg1,
typename Arg2,
556 typename std::enable_if<
559 ,
bool>::type =
true>
560 conditional::GreaterThan<
562 typename std::remove_reference<Arg1>::type,
564 typename std::remove_reference<Arg2>::type::Type
566 return {std::forward<Arg1>(c1), std::forward<Arg2>(f2)};
569 namespace conditional {
580 template<
typename P1,
typename P2>
586 return this->
template call<0>(l, t) >= this->
template call<1>(l, t);
604 template<
typename Arg1,
typename Arg2,
605 typename std::enable_if<
608 ,
bool>::type =
true>
609 conditional::GreaterThanOrEqual<
611 typename std::remove_reference<Arg1>::type::Type,
613 typename std::remove_reference<Arg2>::type::Type
615 return {std::forward<Arg1>(f1), std::forward<Arg2>(f2)};
632 template<
typename Arg1,
typename Arg2,
633 typename std::enable_if<
636 ,
bool>::type =
true>
637 conditional::GreaterThanOrEqual<
639 typename std::remove_reference<Arg1>::type::Type,
641 typename std::remove_reference<Arg2>::type
643 return {std::forward<Arg1>(f1), std::forward<Arg2>(c2)};
660 template<
typename Arg1,
typename Arg2,
661 typename std::enable_if<
664 ,
bool>::type =
true>
665 conditional::GreaterThanOrEqual<
667 typename std::remove_reference<Arg1>::type,
669 typename std::remove_reference<Arg2>::type::Type
671 return {std::forward<Arg1>(c1), std::forward<Arg2>(f2)};
Definition: function.h:349
Function(Fcts &&... fcts)
Definition: function.h:383
Definition: conditional.h:56
bool operator()(led l, time t) const override
Definition: conditional.h:60
Definition: conditional.h:581
bool operator()(led l, time t) const override
Definition: conditional.h:585
Definition: conditional.h:476
bool operator()(led l, time t) const override
Definition: conditional.h:480
Definition: conditional.h:33
T operator()(led l, time t) const override
Definition: conditional.h:37
Definition: conditional.h:371
bool operator()(led l, time t) const override
Definition: conditional.h:375
Definition: conditional.h:266
bool operator()(led l, time t) const override
Definition: conditional.h:270
Definition: conditional.h:161
bool operator()(led l, time t) const override
Definition: conditional.h:165
Definition: animation.cpp:3
conditional::LessThan< typename std::remove_reference< Arg1 >::type::Type, typename std::remove_reference< Arg2 >::type::Type > operator<(Arg1 &&f1, Arg2 &&f2)
Definition: conditional.h:299
conditional::GreaterThanOrEqual< typename std::remove_reference< Arg1 >::type::Type, typename std::remove_reference< Arg2 >::type::Type > operator>=(Arg1 &&f1, Arg2 &&f2)
Definition: conditional.h:614
conditional::LessThanOrEqual< typename std::remove_reference< Arg1 >::type::Type, typename std::remove_reference< Arg2 >::type::Type > operator<=(Arg1 &&f1, Arg2 &&f2)
Definition: conditional.h:404
conditional::NotEqual< typename std::remove_reference< Arg1 >::type::Type, typename std::remove_reference< Arg2 >::type::Type > operator!=(Arg1 &&f1, Arg2 &&f2)
Definition: conditional.h:194
unsigned long time
Definition: time.h:10
conditional::GreaterThan< typename std::remove_reference< Arg1 >::type::Type, typename std::remove_reference< Arg2 >::type::Type > operator>(Arg1 &&f1, Arg2 &&f2)
Definition: conditional.h:509
bool operator==(const color &c1, const color &c2)
Definition: color.cpp:181
static constexpr bool value
Definition: function.h:82