Skip to content

[bugfix] Various fixes for Std::optional

Carsten Gräser requested to merge feature/fix-optional into master
  • Centralize call of placement new
  • Cast away constness of &value_ in placement new. Otherwise placement new is not allowed. Since this only happens in non-const member functions, we're still const correct at the Std::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 the enable_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).

Merge request reports