tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
ratio_greater_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_GREATER_EQUAL_HPP
5#define TETL_RATIO_GREATER_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 greater than or equal to the ratio R2, provides the member constant
14/// value equal true. Otherwise, value is false.
15/// \ingroup ratio
16template <typename R1, typename R2>
17struct ratio_greater_equal : bool_constant<(R1::num * R2::den >= R2::num * R1::den)> { };
18
19/// \relates ratio_greater_equal
20/// \ingroup ratio
21template <typename R1, typename R2>
23
24} // namespace etl
25
26#endif // TETL_RATIO_GREATER_EQUAL_HPP
constexpr bool ratio_greater_equal_v
Definition ratio_greater_equal.hpp:22
Definition adjacent_find.hpp:9
Compares two ratio objects for equality at compile-time. If the ratio R1 is greater than or equal to ...
Definition ratio_greater_equal.hpp:17