<div dir="ltr">"::new(&__null_state_) value_type(...)" seems a bit strange (and I'm concerned that it would probably lead to undefined behavior, if we actually had comprehensible rules for unions...). Maybe "::new(addressof(__val_)) value_type(...)"?<div>
<br></div><div>Do you need the (in_place_t, initializer_list, Args...) constructor in __optional_storage? The (in_place_t, Args...) constructor looks like it would appropriately handle initializer_list construction, since the optional constructor will have already selected the right argument type.</div>
<div><br></div><div>Oh god, there's overload sets for operator->(), operator*(), value(), and value_or(), where one is constexpr and the other isn't. That's awful (and unnecessary in C++14). =( Is there an LWG issue on that?</div>
<div><br></div><div>(You can also use __builtin_addressof in recent versions of Clang to make these constexpr whether or not there is an overloaded operator&, but I don't think the current standard actually allows you to do that...)</div>
<div><br></div><div>__has_operator_addressof_imp is not robust against operator&() returning a type with an overloaded operator,(), and will trigger the instantiation of the return type of operator&() (which might fail) when looking for such an operator,(). I suggest following the pattern in __is_constructible_test:</div>
<div><br></div><div>static auto __test(_Up* __u)</div><div>  -> typename __select_2nd<decltype(__u->operator&()), true_type>::type;</div><div><br></div><div>Looks like __is_assignable_test has the same bug, FWIW.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 29, 2013 at 2:17 PM, Howard Hinnant <span dir="ltr"><<a href="mailto:hhinnant@apple.com" target="_blank">hhinnant@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Please review, thanks.<br>
<span class="HOEnZb"><font color="#888888"><br>
Howard<br>
</font></span><br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>