git_issue_30.cpp 785 B

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