Open fangzhouxia opened 1 year ago
Description: After the MSVC team implented P2468R2 The Equality Operator You Are Looking For, the error we encountered when compiling Trojan(Trojan depends on boost/date_time) under /std:c++latest, the error is due to the operator== https://github.com/boostorg/date_time/blob/develop/include/boost/date_time/time.hpp#L137. In order to fix this the 'ref' log_entry::ref class need to add a corresponding 'operator!=' like so, could you please look this issue? Thanks.
bool operator!=(const time_type& rhs) const { return time_system::isequal(time,rhs.time_); }
Note: this issue will be reproduced on next release version of VS(17.6 or later).
Reproduction steps:
Expected behavior: Build successfully.
Actual behavior: build (1).log F:\tools\boost_1_67_0\x64\boost/asio/ssl/detail/io.hpp(152): error C2666: 'boost::date_time::base_timeboost::posix_time::ptime,boost::posix_time::posix_time_system::operator ==': overloaded functions have similar conversions F:\tools\boost_1_67_0\x64\boost/date_time/time.hpp(126): note: could be 'bool boost::date_time::base_timeboost::posix_time::ptime,boost::posix_time::posix_time_system::operator ==(const boost::posix_time::ptime &) const' F:\tools\boost_1_67_0\x64\boost/date_time/time.hpp(126): note: or 'bool boost::date_time::base_timeboost::posix_time::ptime,boost::posix_time::posix_time_system::operator ==(const boost::posix_time::ptime &) const' [synthesized expression 'y == x'] F:\tools\boost_1_67_0\x64\boost/bind/arg.hpp(48): note: or 'bool boost::operator ==(const boost::arg &,const boost::arg &)' F:\tools\boost_1_67_0\x64\boost/asio/ssl/detail/io.hpp(152): note: 'bool boost::operator ==(const boost::arg &,const boost::arg &)': could not deduce template argument for 'const boost::arg &' from 'boost::posix_time::ptime' F:\tools\boost_1_67_0\x64\boost/optional/detail/optional_relops.hpp(165): note: or 'bool boost::operator ==(boost::none_t,const boost::optional &) noexcept'
Environment: VS version: VS2019(16.11.20) Operating system: windows server 2019
Yes, the mentioned change has landed in VS 17.6 - rolling back to 17.5 avoids the problem for the time being.
Description: After the MSVC team implented P2468R2 The Equality Operator You Are Looking For, the error we encountered when compiling Trojan(Trojan depends on boost/date_time) under /std:c++latest, the error is due to the operator== https://github.com/boostorg/date_time/blob/develop/include/boost/date_time/time.hpp#L137. In order to fix this the 'ref' log_entry::ref class need to add a corresponding 'operator!=' like so, could you please look this issue? Thanks.
bool operator!=(const time_type& rhs) const { return time_system::isequal(time,rhs.time_); }
Note: this issue will be reproduced on next release version of VS(17.6 or later).
Reproduction steps:
Expected behavior: Build successfully.
Actual behavior: build (1).log F:\tools\boost_1_67_0\x64\boost/asio/ssl/detail/io.hpp(152): error C2666: 'boost::date_time::base_timeboost::posix_time::ptime,boost::posix_time::posix_time_system::operator ==': overloaded functions have similar conversions F:\tools\boost_1_67_0\x64\boost/date_time/time.hpp(126): note: could be 'bool boost::date_time::base_timeboost::posix_time::ptime,boost::posix_time::posix_time_system::operator ==(const boost::posix_time::ptime &) const' F:\tools\boost_1_67_0\x64\boost/date_time/time.hpp(126): note: or 'bool boost::date_time::base_timeboost::posix_time::ptime,boost::posix_time::posix_time_system::operator ==(const boost::posix_time::ptime &) const' [synthesized expression 'y == x'] F:\tools\boost_1_67_0\x64\boost/bind/arg.hpp(48): note: or 'bool boost::operator ==(const boost::arg &,const boost::arg &)' F:\tools\boost_1_67_0\x64\boost/asio/ssl/detail/io.hpp(152): note: 'bool boost::operator ==(const boost::arg &,const boost::arg &)': could not deduce template argument for 'const boost::arg &' from 'boost::posix_time::ptime' F:\tools\boost_1_67_0\x64\boost/optional/detail/optional_relops.hpp(165): note: or 'bool boost::operator ==(boost::none_t,const boost::optional &) noexcept'
Environment: VS version: VS2019(16.11.20) Operating system: windows server 2019