cinder / Cinder

Cinder is a community-developed, free and open source library for professional-quality creative coding in C++.
http://libcinder.org
Other
5.28k stars 939 forks source link

[MSVC][std:c++latest] Cinder failed to build due to error C2666: 'CRect::operator ==': overloaded functions have similar conversions #2302

Open Zhaojun-Liu opened 1 year ago

Zhaojun-Liu commented 1 year ago

Description: After the MSVC team implemented P2468R2 The Equality Operator You Are Looking For, we got a compiler error with /std:c++latest like below, the error is due to the equality operator here https://github.com/cinder/Cinder/blob/master/src/AntTweakBar/TwMgr.h#L369 needs a 'const'. Could you please look this issue? Thanks.

F:\gitP\cinder\Cinder\src\AntTweakBar\TwMgr.cpp(2176,71): error C2666: 'CRect::operator ==': overloaded functions have similar conversions [F:\gitP\cinder\Cinder\build_amd64\cinder.vcxproj]

Note: this issue will be reproduced on next release version of VS(VS17.6 or later)

Repro steps:

  1. open VC2019 x64 tools command
  2. git clone https://github.com/cinder/Cinder F:\gitP\cinder\Cinder
  3. mkdir F:\gitP\cinder\Cinder\build_amd64
  4. cd F:\gitP\cinder\Cinder\build_amd64
  5. cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_BUILD_TYPE=Release -DCINDER_BUILD_TESTS=ON ..
  6. set CL= /std:c++latest /D_HAS_DEPRECATED_UNCAUGHT_EXCEPTION=1 /D_SILENCE_CXX17_UNCAUGHT_EXCEPTION_DEPRECATION_WARNING
  7. msbuild /m /p:Platform=x64 /p:Configuration=Release cinder.sln /t:Rebuild > build.log

Detailed log: build.log

vinhnguyen500 commented 8 months ago

This is also reproducible with a Visual Studio 17 2022 generator