Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please include <utility> for std::cmp_less_equal #9

Merged
merged 1 commit into from
Sep 7, 2024

Conversation

toge
Copy link
Contributor

@toge toge commented Sep 5, 2024

I met compilation error in gcc 14.2.1.
This PR tries to fix it.

In file included from include/fixed_math/math.h:8,
                 from include/fixed_math/fixed_math.hpp:9,
                 from test_package.cpp:2:
include/fixed_math/core_ops.h: In static member function ‘static constexpr fixedmath::v2::fixed_t fixedmath::v2::arithmetic_to_fixed_t::operator()(arithmetic_type)’:
include/fixed_math/core_ops.h:34:15: error: ‘cmp_less_equal’ is not a member of ‘std’
   34 |       if(std::cmp_less_equal(value, detail::limits_::max_integral())
      |               ^~~~~~~~~~~~~~
include/fixed_math/core_ops.h:13:1: note: ‘std::cmp_less_equal’ is defined in header ‘<utility>’; this is probably fixable by adding ‘#include <utility>’
   12 | #include "detail/static_call_operator_prolog.h"
  +++ |+#include <utility>
   13 | 
include/fixed_math/core_ops.h:35:18: error: ‘cmp_greater_equal’ is not a member of ‘std’
   35 |          && std::cmp_greater_equal(value, detail::limits_::min_integral())) [[likely]]
      |                  ^~~~~~~~~~~~~~~~~
include/fixed_math/core_ops.h:35:18: note: ‘std::cmp_greater_equal’ is defined in header ‘<utility>’; this is probably fixable by adding ‘#include <utility>’
include/fixed_math/core_ops.h: In static member function ‘static constexpr arithmethic_type fixedmath::v2::fixed_to_arithmetic_t<arithmethic_type>::operator()(auto:20)’:
include/fixed_math/core_ops.h:88:15: error: ‘cmp_greater_equal’ is not a member of ‘std’
   88 |       if(std::cmp_greater_equal(tmp, integral_min) && std::cmp_less_equal(tmp, integral_max))
      |               ^~~~~~~~~~~~~~~~~
include/fixed_math/core_ops.h:88:15: note: ‘std::cmp_greater_equal’ is defined in header ‘<utility>’; this is probably fixable by adding ‘#include <utility>’
include/fixed_math/core_ops.h:88:60: error: ‘cmp_less_equal’ is not a member of ‘std’
   88 |       if(std::cmp_greater_equal(tmp, integral_min) && std::cmp_less_equal(tmp, integral_max))
      |                                                            ^~~~~~~~~~~~~~
include/fixed_math/core_ops.h:88:60: note: ‘std::cmp_less_equal’ is defined in header ‘<utility>’; this is probably fixable by adding ‘#include <utility>’

@arturbac arturbac merged commit 980cdea into arturbac:master Sep 7, 2024
4 checks passed
@arturbac
Copy link
Owner

arturbac commented Sep 7, 2024

Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants