FastLED 3.9.15
Loading...
Searching...
No Matches
utility.h
Go to the documentation of this file.
1#pragma once
2#include "fl/type_traits.h"
3
4namespace fl {
5
14template <typename T = void> struct less {
22 constexpr bool operator()(const T &lhs, const T &rhs) const {
23 return lhs < rhs;
24 }
25};
26
33template <> struct less<void> {
43 template <typename T, typename U>
44 constexpr auto operator()(T &&lhs, U &&rhs) const
45 -> decltype(fl::forward<T>(lhs) < fl::forward<U>(rhs)) {
46 return fl::forward<T>(lhs) < fl::forward<U>(rhs);
47 }
48};
49
50// Backward compatibility alias
51template <typename T> using DefaultLess = less<T>;
52
53} // namespace fl
constexpr T && forward(typename remove_reference< T >::type &t) noexcept
less< T > DefaultLess
Definition utility.h:51
IMPORTANT!
Definition crgb.h:20
constexpr auto operator()(T &&lhs, U &&rhs) const -> decltype(fl::forward< T >(lhs)< fl::forward< U >(rhs))
Function call operator that performs the less-than comparison.
Definition utility.h:44
constexpr bool operator()(const T &lhs, const T &rhs) const
Function call operator that performs the less-than comparison.
Definition utility.h:22
Binary function object that returns whether the first argument is less than the second.
Definition utility.h:14