]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/optional/test/optional_test_equals_none.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / optional / test / optional_test_equals_none.cpp
CommitLineData
7c673cae
FG
1// Copyright (C) 2014 Andrzej Krzemienski.
2//
3// Use, modification, and distribution is subject to the Boost Software
4// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5// http://www.boost.org/LICENSE_1_0.txt)
6//
7// See http://www.boost.org/lib/optional for documentation.
8//
9// You are welcome to contact the author at:
10// akrzemi1@gmail.com
11
12#include "boost/optional/optional.hpp"
13
20effc67 14#ifdef BOOST_BORLANDC
7c673cae
FG
15#pragma hdrstop
16#endif
17
18#include "boost/core/lightweight_test.hpp"
19#include "boost/none.hpp"
20
21
22struct SemiRegular // no operator==
23{
24private: void operator==(SemiRegular const&) const {}
25private: void operator!=(SemiRegular const&) const {}
26};
27
28void test_equal_to_none_of_noncomparable_T()
29{
30 boost::optional<SemiRegular> i = SemiRegular();
31 boost::optional<SemiRegular> o;
32
33 BOOST_TEST(i != boost::none);
34 BOOST_TEST(boost::none != i);
35 BOOST_TEST(o == boost::none);
36 BOOST_TEST(boost::none == o);
37}
38
39int main()
40{
41 test_equal_to_none_of_noncomparable_T();
42 return boost::report_errors();
43}