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: [email protected]
10 
11 
12 #include "boost/optional/optional.hpp"
13 
14 #ifdef BOOST_BORLANDC
15 #pragma hdrstop
16 #endif
17 
18 #include "boost/core/lightweight_test.hpp"
19 #include "testable_classes.hpp"
20 #include "optional_ref_assign_test_defs.hpp"
21 
22 using boost::optional;
23 using boost::none;
24 
25 
26 template <typename T>
test_optional_ref_assignment()27 void test_optional_ref_assignment()
28 {
29   test_copy_assignment_for<T>();
30   test_rebinding_assignment_semantics<T>();
31 
32   test_copy_assignment_for_const<T>();
33   test_copy_assignment_for_noconst_const<T>();
34   test_rebinding_assignment_semantics_const<T>();
35   test_rebinding_assignment_semantics_noconst_const<T>();
36 }
37 
main()38 int main()
39 {
40   test_optional_ref_assignment<ScopeGuard>();
41   test_optional_ref_assignment<Abstract>();
42   test_optional_ref_assignment< optional<int> >();
43 
44   return boost::report_errors();
45 }
46