// 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 "./test.hpp" #include #include using std::string; using std::wstring; namespace { namespace local { DECLARE_HAS_MEMBER(has_foo, foo); struct no1 { void zoo () {} }; struct yes1 { void operator() () {} }; struct yes2 { void operator() () const {} }; struct yes3 { int operator() (int) { return 0; } }; struct yes4 { int operator() (int) const { return 0; } }; struct yes5 { int foo; void moo() {} }; struct yes6 { void foo () {} }; struct yes7 { void foo () const {} }; struct yes8 { void* foo (char const*, int) { return 0; } }; struct yes9 { 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(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(); }