]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/optional/test/optional_xconfig_NO_PROPER_ASSIGN_FROM_CONST_INT_pass.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / optional / test / optional_xconfig_NO_PROPER_ASSIGN_FROM_CONST_INT_pass.cpp
1 // Copyright (C) 2015 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/core/lightweight_test.hpp"
13 #include "boost/optional/detail/optional_config.hpp"
14
15 #ifndef BOOST_OPTIONAL_CONFIG_NO_PROPER_ASSIGN_FROM_CONST_INT
16
17 const int global_i = 0;
18
19 struct Binder
20 {
21 void operator=(const int& i)
22 {
23 BOOST_TEST(&i == &global_i);
24 }
25 };
26
27 int main()
28 {
29 Binder s;
30 s = global_i;
31 return boost::report_errors();
32 }
33
34 #else
35
36 int main()
37 {
38 return boost::report_errors();
39 }
40
41 #endif