tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
ratio_less_equal.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4#ifndef TETL_RATIO_LESS_EQUAL_HPP
5#define TETL_RATIO_LESS_EQUAL_HPP
6
7#include <etl/_ratio/ratio.hpp>
8#include <etl/_type_traits/bool_constant.hpp>
9
10namespace etl {
11
12/// \brief Compares two ratio objects for equality at compile-time. If the ratio
13/// R1 is less than or equal to the ratio R2, provides the member constant value
14/// equal true. Otherwise, value is false.
15/// \ingroup ratio
16template <typename R1, typename R2>
17struct ratio_less_equal : bool_constant<(R1::num * R2::den <= R2::num * R1::den)> { };
18
19/// \ingroup ratio
20template <typename R1, typename R2>
21inline constexpr bool ratio_less_equal_v = ratio_less_equal<R1, R2>::value;
22
23} // namespace etl
24
25#endif // TETL_RATIO_LESS_EQUAL_HPP
constexpr bool ratio_less_equal_v
Definition ratio_less_equal.hpp:21
Definition adjacent_find.hpp:9
Compares two ratio objects for equality at compile-time. If the ratio R1 is less than or equal to the...
Definition ratio_less_equal.hpp:17