<div dir="ltr"><div class="gmail_extra">Hi<br>I don't understand this code:<br>
<br>
_LIBCPP_NEW_DELETE_VIS void* operator new(std::size_t __sz)<br>
#if !__has_feature(cxx_noexcept)<br>
+#if defined(_LIBCPP_MSVC)<br>
+ throw(...)<br>
+#else<br>
throw(std::bad_alloc)<br>
#endif<br>
+#endif<br>
;<br>
<br>
Are you anticipating that operator new will throw things other than std::bad_alloc?<br>
Or does MSVC just hate exception specifications?<br>
[ I'm not really that fond of them, but still …. ]</div><div class="gmail_extra"> </div><div class="gmail_extra">Yes I thought the code was a bit weird to begin with too. I'm just adding more of the same. But I think the logic is something like, "exception specifications are deprecated/going away, if the compiler is aware that we don't need them, don't use them. If the compiler isn't aware that we don't need them, use what we know works. for clang that's throw x; meaning we throw x; for msvc that's throw(...) meaning say we throw something, but I don't know what and don't support a meaning of saying what.".<br>
<br>
It's the only place this type of thing is used, so there isn't any value supporting some kind of clever macro for that. The whole ugliness will go away for all compilers soon enough I think.<br>
-- Marshall<br>
<br><br>
<br></div></div>