Closed SeeSoftware closed 5 years ago
This works only if the compiler implements copy-elision. I don't know about what MSVC has changed between those two versions. The single thing we can do is to inhibit this interface for compilers that don't implement copy elision.
PR are welcome.
@SeeSoftware I have opened a PR #240 that solves the problem.
@Kojoley thanks for working on this. Please, could you explain how this solves the issue?
Because boost::is_mutex_type<boost::mutex>::value
is false the wrong overload is chosen, https://github.com/boostorg/thread/blob/fc08c1fe2840baeeee143440fba31ef9e9a813c8/include/boost/thread/lock_algorithms.hpp#L166 instead of https://github.com/boostorg/thread/blob/fc08c1fe2840baeeee143440fba31ef9e9a813c8/include/boost/thread/lock_algorithms.hpp#L144. And because that overload takes arguments by value it tries to find a copy constructor on mutex which is deleted.
I'm trying to compile simple code using boost:synchronized_value with boost::synchronize but i'm having problems doing that:
will result in this error:
What i have found out is that this only happens with MSVC++ compilers and only with /std:c++17 if i try to use c++14 it will compile fine, but i want to use c++17 features. I installed boost with vcpkg if that matters.