default_converter_fail.cpp 516 B

1234567891011121314151617181920
  1. // Boost.Convert test and usage example
  2. // Copyright (c) 2009-2016 Vladimir Batov.
  3. // Use, modification and distribution are subject to the Boost Software License,
  4. // Version 1.0. See http://www.boost.org/LICENSE_1_0.txt.
  5. #include <boost/convert.hpp>
  6. using std::string;
  7. using boost::convert;
  8. // This is expected to fail to compile:
  9. //'boost::cnv::by_default' : class has no constructors.
  10. int
  11. main(int, char const* [])
  12. {
  13. int i = convert<int>("123").value();
  14. string s = convert<string>(123).value();
  15. }