]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/optional/test/optional_test_tc_base.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / optional / test / optional_test_tc_base.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
20 #if defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
21
22 int main()
23 {
24 }
25
26 #else
27
28 #include <utility>
29
30 struct NotDefaultConstructible
31 {
32 NotDefaultConstructible() = delete;
33 };
34
35 void test_tc_base()
36 {
37 boost::optional<NotDefaultConstructible> o;
38
39 BOOST_TEST(boost::none == o);
40 }
41
42 struct S
43 {
44
45 };
46
47 template<class T>
48 struct W
49 {
50 T& t_;
51
52 template<class... Args>
53 W(Args&&... args)
54 : t_(std::forward<Args>(args)...)
55 {
56 }
57 };
58
59 void test_value_init()
60 {
61 {
62 S s;
63 W<S> w{s};
64 }
65 boost::optional<W<S&> > o;
66 BOOST_TEST(boost::none == o);
67 }
68
69 int main()
70 {
71 test_tc_base();
72 test_value_init();
73 return boost::report_errors();
74 }
75
76 #endif