microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.21k stars 6.39k forks source link

boost 1.74 operators infinite recursion #15813

Open niclar opened 3 years ago

niclar commented 3 years ago

https://github.com/boostorg/utility/issues/65

Known error in boost operators that manifests itself as an infinite recursion in gcc,clang (c++2a) and now visual studo 2019 Version 16.9.0 Preview 3.0 (/std:c++latest).

I'll open a PR for the windows part with something like;

template <class T, class U, class B = operators_detail::empty_base<T> >
struct equality_comparable2 : B
{
//https://github.com/boostorg/utility/issues/65
#if __cplusplus < 201705L
     friend BOOST_OPERATORS_CONSTEXPR bool operator==(const U& y, const T& x) { return x == y; }
#endif
     friend BOOST_OPERATORS_CONSTEXPR bool operator!=(const U& y, const T& x) { return !static_cast<bool>(x == y); }
     friend BOOST_OPERATORS_CONSTEXPR bool operator!=(const T& y, const U& x) { return !static_cast<bool>(y == x); }
};
yurybura commented 3 years ago

@PhoebeHui Boost was updated.

niclar commented 3 years ago

@yurybura this issue very much remains though (not changed in boost 1.77).

(I'll file the PR as soon as I get some time over.)

FrankXie05 commented 2 years ago

@niclar Is there any progress on the issue? Does the problem still exist in the latest version?

niclar commented 2 years ago

@FrankXie05 still there. I'll get a PR out there in a bit. Just use the code above

FrankXie05 commented 2 years ago

@niclar Thanks for your reply, I will continue to follow up on this issue.

FrankXie05 commented 2 years ago

@niclar Upstream attempts to fix this, Can you go and verify it? see: https://github.com/boostorg/utility/commit/f3963f5375799f3e3577edfafd2579e4b6481258

JackBoosY commented 2 years ago

We need the upstream to confirm https://github.com/boostorg/utility/issues/65 is fixed.

JonLiu1993 commented 10 months ago

@Lastique, the latest boost version 1.8.4 have been fixed this issue?

Lastique commented 10 months ago

Not to my knowledge.