// Boost.Convert test and usage example // Copyright (c) 2009-2014 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 #ifdef BOOST_CONVERT_BROKEN_COMPILER int main(int, char const* []) { return 0; } #else #include "./test.hpp" #include #include using std::string; using std::wstring; namespace { namespace local { BOOST_DECLARE_HAS_MEMBER(has_foo, foo); struct no1 { void zoo () {} }; struct yes01 { void operator() () {} }; struct yes02 { void operator() () const {} }; struct yes03 { int operator() (int) { return 0; } }; struct yes04 { int operator() (int) const { return 0; } }; struct yes05 { int operator() (int) const { return 0; } void operator() () const {} }; struct yes11 { int foo; void moo() {} }; struct yes12 { void foo () {} }; struct yes13 { void foo () const {} }; struct yes14 { void* foo (char const*, int) { return 0; } }; struct yes15 { void* foo (char const*, int) const { return 0; } }; }} int main(int argc, char const* argv[]) { BOOST_TEST(boost::cnv::has_funop::value == false); BOOST_TEST( local::has_foo::value == false); BOOST_TEST(boost::cnv::has_funop::value == true); BOOST_TEST(boost::cnv::has_funop::value == true); BOOST_TEST(boost::cnv::has_funop::value == true); BOOST_TEST(boost::cnv::has_funop::value == true); BOOST_TEST(boost::cnv::has_funop::value == true); BOOST_TEST(local::has_foo::value == true); BOOST_TEST(local::has_foo::value == true); BOOST_TEST(local::has_foo::value == true); BOOST_TEST(local::has_foo::value == true); BOOST_TEST(local::has_foo::value == true); return boost::report_errors(); } #endif