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 6 #include <boost/convert.hpp> 7 8 using std::string; 9 using boost::convert; 10 11 // This is expected to fail to compile: 12 //'boost::cnv::by_default' : class has no constructors. 13 14 int main(int,char const * [])15main(int, char const* []) 16 { 17 int i = convert<int>("123").value(); 18 string s = convert<string>(123).value(); 19 } 20 21