[bugfix] Various fixes for Std::optional
- Centralize call of placement
new
- Cast away constness of
&value_
in placementnew
. Otherwise placement new is not allowed. Since this only happens in non-const member functions, we're still const correct at theStd::optional
level - Avoid that the greedy eat-anything-constructor
template<class U> optional(U&&)
is considered in place of the explicitly given ones by fixing theenable_if
guards. - Disable assignment for const types. Before the overload existed for these cases but was broken. Now it's properly disabled allowing to check for assignability.
This fixes #139 (closed).