tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
ratio_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_EQUAL_HPP
5#define TETL_RATIO_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
13/// ratios R1 and R2 are equal, provides the member constant value equal true.
14/// Otherwise, value is false.
15/// \ingroup ratio
16template <typename R1, typename R2>
17struct ratio_equal : bool_constant<R1::num == R2::num && R1::den == R2::den> { };
18
19/// \relates ratio_equal
20/// \ingroup ratio
21template <typename R1, typename R2>
22inline constexpr bool ratio_equal_v = ratio_equal<R1, R2>::value;
23
24} // namespace etl
25
26#endif // TETL_RATIO_EQUAL_HPP
constexpr bool ratio_equal_v
Definition ratio_equal.hpp:22
Definition adjacent_find.hpp:9
Compares two ratio objects for equality at compile-time. If the ratios R1 and R2 are equal,...
Definition ratio_equal.hpp:17