- edited description
upcxx::optional does not conform to C++17 std::optional interface
Issue #589
wontfix
Our implementation of optional
diverges from the standard C++17 interface in several places. For instance:
emplace()
does not return a reference to the newly created object (fix forthcoming via PR 475).- There are several constructor and assignment-operator overloads that we do not implement.
operator*()
andvalue()
are missingconst&&
overloads.- There are still some residual
optional<T&>
specializations (comparison operators,std::hash
). - Comparison operators do not allow comparison between
optional<T>
andoptional<U>
orU
whereU != T
.
There may be other diversions as well.
Comments (3)
-
reporter -
reporter PR 479 fixes the following:
- Adds
operator*() const&&
andvalue() const&&
overloads for compilers that have move accessors. - Removes residual
optional<T&>
specializations. - Adds comparisons between
optional<T>
andoptional<U>
/U
.
The following is still outstanding:
- There are several constructor and assignment-operator overloads that we do not implement.
- Adds
-
- changed status to wontfix
We don't plan to fix the remaining non-compliances.
Users encountering limitations of our
upcxx::optional
shim are advised to build using-std=c++17
to activate thestd::optional
implementation. - Log in to comment