// Boost.Convert test and usage example // Copyright (c) 2009-2016 Vladimir Batov. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. See http://www.boost.org/LICENSE_1_0.txt. #include "./test.hpp" #if defined(BOOST_CONVERT_IS_NOT_SUPPORTED) int main(int, char const* []) { return 0; } #else #include #include #include using std::string; using std::wstring; namespace { namespace local { typedef void not_converter01 (string const&); typedef void not_converter02 (int const&, string const&); typedef void not_converter03 (); typedef void converter01 (int const&, boost::optional&); typedef void converter02 (double const&, boost::optional&); struct converter11 { void operator()(int const&, boost::optional&) {} void operator()(double const&, boost::optional&) {} void operator()(string const&, boost::optional&) {} }; struct converter12 { template void operator()(TypeIn const&, boost::optional&) {} }; struct converter13 { void operator()(int const&, boost::optional&) {} }; struct converter14 { void operator()(int const&, boost::optional&) const {} }; struct not_converter11 { }; struct not_converter12 { void operator()() {} }; struct not_converter13 { void operator()(int const&, string const&) {} }; }} int main(int, char const* []) { BOOST_TEST( (boost::cnv::is_cnv::value)); BOOST_TEST( (boost::cnv::is_cnv::value)); BOOST_TEST( (boost::cnv::is_cnv::value)); BOOST_TEST( (boost::cnv::is_cnv::value)); BOOST_TEST( (boost::cnv::is_cnv::value)); BOOST_TEST( (boost::cnv::is_cnv::value)); BOOST_TEST( (boost::cnv::is_cnv::value)); BOOST_TEST( (boost::cnv::is_cnv::value)); BOOST_TEST( (boost::cnv::is_cnv::value)); BOOST_TEST( (boost::cnv::is_cnv::value)); BOOST_TEST( (boost::cnv::is_cnv::value)); BOOST_TEST( (boost::cnv::is_cnv::value)); BOOST_TEST( (boost::cnv::is_cnv::value)); BOOST_TEST(!(boost::cnv::is_cnv::value)); BOOST_TEST(!(boost::cnv::is_cnv::value)); BOOST_TEST(!(boost::cnv::is_cnv::value)); BOOST_TEST(!(boost::cnv::is_cnv::value)); BOOST_TEST(!(boost::cnv::is_cnv::value)); BOOST_TEST(!(boost::cnv::is_cnv::value)); BOOST_TEST(!(boost::cnv::is_cnv::value)); return boost::report_errors(); } #endif