Posted Mar 10, 2013 19:16 UTC (Sun) by jwakely (subscriber, #60262)
In reply to: MSVC by Cyberax
Parent article: Michaelsen: One
You *still* don't know what you're talking about.
> By definition constexprs can't have any side effects (in fact, allowing side effects is a compiler bug).
I'll start you off with 7.1.5 [dcl.constexpr] which says "The definition of a constexpr constructor shall satisfy the following constraints: [...] every non-variant non-static data member and base class sub-object shall be initialized"
Please show where in the standard it contradicts that or how to initialize non-static data members without side-effects.
> So using constexprs to allocate a mutex is right out
On a grown-up OS mutexes don't need "allocating" so can be constexpr.
If you disagree please file a defect with the C++ standard, file a GCC bug (category "doing impossible things before breakfast") and tell MS to stop working on the fix to not allocate memory in std::mutex because it's an impossible task, so sayeth Cyberax the unknowing.
I don't think you know what a constexpr constructor is or how it works. Stop trying to educate me on C++, you're embarassing yourself.