boostorg / boost

Super-project for modularized Boost
https://github.com/boostorg/wiki/wiki/Getting-Started%3A-Overview
Boost Software License 1.0
7.13k stars 1.75k forks source link

VS2022 / c++20 boost::signals2::disconnect compilation error #811

Closed laurentcau closed 1 year ago

laurentcau commented 1 year ago

Hello,

We're upgrading our c++ projects to Visual studio 2022 / c++20 and we have an compiler error with boost::signals2::signal::disconnect + boost::bind. ...\include\boost\signals2\detail\signal_template.hpp(530,46): error C2088: '==': illegal for class Here is an example:

class CTest
{
public:
       boost::signals2::signal<void()> mySignal;
    CTest()
    {
        mySignal.connect(boost::bind(&CTest::Method, this));
        mySignal.disconnect(boost::bind(&CTest::Method, this)); //=> generates error with VS 2022 c++20, not with c++17
    }

    void Method()
    {}
};

Is there a workaround for this ? Thanks Regards, Laurent

laurentcau commented 1 year ago

Sorry, duplicate. I didn't see my previous message was transfered.