Closed russellmcc closed 8 years ago
Yes, I must adapt it to the newest proposal that defaults to T() if T is default constructible. Beside in the defautl constructor, is it used in another location?
Do you have cases where E() is not default constructible?
Yes, most constructors initialize base_type
before doing the work of constructing, which means that error_type
is default-constructed. For example, in the move constructor for value_type
.
It was decided that expected<T,E> would default to T if T is default constructible.
This commit try to fix this. https://github.com/ptal/expected/commit/5639527584417399362f984f23893dd538dbf5ee
Would it be possible to craft expected to not require a default constructible
error_type
?