]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/optional/test/optional_test_convert_from_T.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / optional / test / optional_test_convert_from_T.cpp
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
14 #ifdef __BORLANDC__
15 #pragma hdrstop
16 #endif
17
18 #include "boost/core/lightweight_test.hpp"
19 #include "boost/none.hpp"
20
21 //#ifndef BOOST_OPTIONAL_NO_CONVERTING_COPY_CTOR
22
23 using boost::optional;
24 using boost::none;
25
26 void test_optional_optional_T()
27 {
28 optional<int> oi1 (1), oiN;
29 optional< optional<int> > ooi1 (oi1), ooiN(oiN);
30
31 BOOST_TEST(ooi1);
32 BOOST_TEST(*ooi1);
33 BOOST_TEST_EQ(**ooi1, 1);
34
35 BOOST_TEST(ooiN);
36 BOOST_TEST(!*ooiN);
37 }
38
39 int main()
40 {
41 test_optional_optional_T();
42
43 return boost::report_errors();
44 }