-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<mutex> : std::mutex::mutex is not constexpr #2285
Comments
It is not even documented. I added a PR form |
Could we make |
See #845:
|
Perhaps an LWG issue should be submitted to allow |
Looks like it would be feasible for POSIX platforms as well (https://godbolt.org/z/nqxs1n9xn) if they implement |
Per the discussion in #2286, we believe |
I've tried to look into it. So we need to implement
|
I don't believe this is true, at least for std::mutex's current guarantees, because the vtbl must live in the STL's DLL. Otherwise, mutexes created by a user DLL become radioactive if that user DLL is unloaded. (There's a similar problem in |
@BillyONeal suggested a possible workaround for his concern: use Still there are problems in getting vtable class into mutex:
|
There is a question on Stackoverflow about this issue. |
FWIW, I just got a bug report against Boost.System caused by |
I think this can definitely be fixed for But it didn't work for Edit: I see. I'll create a fake vtable when |
Possible approches (IMO) for
|
This is mentioned in other issues, but I wanted a bug report tracking this explicitly. For the curious see #946.
std::mutex::mutex
isconstexpr
as of c++11, but even in c++17 MSVC will not support it.Minimal repro:
https://godbolt.org/z/5Yc56hEG7
The text was updated successfully, but these errors were encountered: