tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
cmp_greater_equal.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2024 Tobias Hienzsch
3
4#ifndef TETL_UTILITY_CMP_GREATER_EQUAL_HPP
5#define TETL_UTILITY_CMP_GREATER_EQUAL_HPP
6
7#include <etl/_concepts/builtin_integer.hpp>
8#include <etl/_utility/cmp_less.hpp>
9
10namespace etl {
11
12/// Compare the values of two integers t and u. Unlike builtin comparison
13/// operators, negative signed integers always compare less than (and not equal
14/// to) unsigned integers: the comparison is safe against lossy integer
15/// conversion.
16///
17/// https://en.cppreference.com/w/cpp/utility/intcmp
18///
19/// \ingroup utility
20template <builtin_integer T, builtin_integer U>
21[[nodiscard]] constexpr auto cmp_greater_equal(T t, U u) noexcept -> bool
22{
23 return not etl::cmp_less(t, u);
24}
25
26} // namespace etl
27
28#endif // TETL_UTILITY_CMP_GREATER_EQUAL_HPP
constexpr auto cmp_greater_equal(T t, U u) noexcept -> bool
Compare the values of two integers t and u. Unlike builtin comparison operators, negative signed inte...
Definition cmp_greater_equal.hpp:21
Definition adjacent_find.hpp:9