make_decl.cpp 740 B

123456789101112131415161718192021222324
  1. // Copyright (C) 2009-2012 Lorenzo Caminiti
  2. // Distributed under the Boost Software License, Version 1.0
  3. // (see accompanying file LICENSE_1_0.txt or a copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. // Home at http://www.boost.org/libs/functional/overloaded_function
  6. #include "identity.hpp"
  7. #include <boost/functional/overloaded_function.hpp>
  8. #include <boost/typeof/typeof.hpp>
  9. #include <boost/core/lightweight_test.hpp>
  10. int main() {
  11. //[identity_make_decl
  12. BOOST_AUTO(identity, boost::make_overloaded_function(
  13. identity_s, identity_i, identity_d));
  14. BOOST_TEST(identity("abc") == "abc");
  15. BOOST_TEST(identity(123) == 123);
  16. BOOST_TEST(identity(1.23) == 1.23);
  17. //]
  18. return boost::report_errors();
  19. }