Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1 | |
| 2 | // Copyright (C) 2009-2012 Lorenzo Caminiti |
| 3 | // Distributed under the Boost Software License, Version 1.0 |
| 4 | // (see accompanying file LICENSE_1_0.txt or a copy at |
| 5 | // http://www.boost.org/LICENSE_1_0.txt) |
| 6 | // Home at http://www.boost.org/libs/functional/overloaded_function |
| 7 | |
| 8 | #include "identity.hpp" |
| 9 | #include <boost/functional/overloaded_function.hpp> |
| 10 | #include <boost/detail/lightweight_test.hpp> |
| 11 | |
| 12 | //[identity_make_checks |
| 13 | template<typename F> |
| 14 | void check(F identity) { |
| 15 | BOOST_TEST(identity("abc") == "abc"); |
| 16 | BOOST_TEST(identity(123) == 123); |
| 17 | BOOST_TEST(identity(1.23) == 1.23); |
| 18 | } |
| 19 | //] |
| 20 | |
| 21 | int main() { |
| 22 | //[identity_make_call |
| 23 | check(ndnboost::make_overloaded_function(identity_s, identity_i, identity_d)); |
| 24 | //] |
| 25 | return ndnboost::report_errors(); |
| 26 | } |
| 27 | |