Add all the relational operators to std::experimental::optional. Also update bad_optional_access to match the Library Fundamentals draft standard. This is not all of the upcoming changes to optional, though.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223775 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2014-12-09 14:49:17 +00:00
parent fff544efbd
commit 4ad67e08cb
24 changed files with 1047 additions and 266 deletions

View File

@@ -38,21 +38,21 @@ int main()
typedef optional<T> O;
constexpr T val(2);
constexpr O o1; // disengaged
constexpr O o2{1}; // engaged
constexpr O o1; // disengaged
constexpr O o2{1}; // engaged
constexpr O o3{val}; // engaged
static_assert ( !(o1 == T(1)), "" );
static_assert ( o2 == T(1), "" );
static_assert ( (o2 == T(1)), "" );
static_assert ( !(o3 == T(1)), "" );
static_assert ( o3 == T(2) , "" );
static_assert ( o3 == val, "" );
static_assert ( (o3 == T(2)), "" );
static_assert ( (o3 == val), "" );
static_assert ( !(T(1) == o1), "" );
static_assert ( T(1) == o2, "" );
static_assert ( (T(1) == o2), "" );
static_assert ( !(T(1) == o3), "" );
static_assert ( T(2) == o3 , "" );
static_assert ( val == o3 , "" );
static_assert ( (T(2) == o3), "" );
static_assert ( (val == o3), "" );
}
#endif
}