Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / multiprecision / test / git_issue_30.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 #include <boost/multiprecision/cpp_int.hpp>
7
8 struct E
9 {
10    E(boost::multiprecision::cpp_rational const&)
11    {
12    }
13 };
14
15 void g(boost::multiprecision::cpp_rational const& r)
16 {
17    std::cout << r << std::endl;
18 }
19
20 int main()
21 {
22 #if !defined(BOOST_MP_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) && !(defined(__APPLE_CC__) && defined(CI_SUPPRESS_KNOWN_ISSUES))
23    boost::multiprecision::cpp_int r = 3;
24    g(r);
25    E x1(r); // triggers explicit conversion operator.
26 #endif
27    return 0;
28 }