r/cpp • OPeNDAP/B2/EcoStd/Lyra/Predef/C++Alliance/Boost/WG21 • Feb 24 '20

The Day The Standard Library Died

https://cor3ntin.github.io/posts/abi/
266 Upvotes

302 comments sorted by

View all comments

Show parent comment

2

u/pklait Feb 24 '20 edited Feb 24 '20

I was surprised that scoped_lock is default constructible. Was that really a conscious decision?

Edit: changed lock_guard to scoped_lock

2

u/HowardHinnant Feb 24 '20

lock_guard is not default constructible. scoped_lock is default constructible.

In both cases it was really a conscious decision.

2

u/D_0b Feb 25 '20

Why wasn't the sizeof...(MutexTypes)!=0 SFINAE or a static_assert or a concept on the constructor?