]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/multiprecision/test/bug11922.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / multiprecision / test / bug11922.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright 2016 John Maddock. Distributed under the Boost
3 // Software License, Version 1.0. (See accompanying file
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6
7 #include <boost/multiprecision/cpp_int.hpp>
8 #include <memory>
9
10 typedef boost::multiprecision::cpp_int mp_int;
11
12 #if !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) && !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
13
14 class Int1 {
15 public:
16 Int1(const mp_int& i) {}
17 Int1(const Int1& i) {}
18 };
19
20 class Int2 {
21 public:
22 Int2(const mp_int& i) {}
23 Int2(const Int2& i) = delete;
24 };
25
26
27 int main()
28 {
29 using namespace boost::multiprecision;
30
31 mp_int i(10);
32 Int1 a(i + 10);
33 Int2 b(i + 20);
34
35 #ifndef BOOST_NO_CXX11_SMART_PTR
36
37 std::shared_ptr<Int1> p1 = std::make_shared<Int1>(i + 10);
38 std::shared_ptr<Int2> p2 = std::make_shared<Int2>(i + 10);
39
40 #endif
41
42 return 0;
43 }
44
45 #else
46
47 int main() { return 0; }
48
49 #endif