blob: 85c5a2cac21fca3f624be5cd63967335862c21a1 [file] [log] [blame]
Jeff Thompsona28eed82013-08-22 16:21:10 -07001
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#ifndef IDENTITY_HPP_
9#define IDENTITY_HPP_
10
11//[identity_typeof
12#include <boost/typeof/std/string.hpp> // No need to register `ndnboost::function`.
13//]
14#include <boost/function.hpp>
15#include <string>
16
17//[identity_decls
18const std::string& identity_s(const std::string& x) // Function (as pointer).
19 { return x; }
20
21int identity_i_impl(int x) { return x; }
22int (&identity_i)(int) = identity_i_impl; // Function reference.
23
24double identity_d_impl(double x) { return x; }
25ndnboost::function<double (double)> identity_d = identity_d_impl; // Functor.
26//]
27
28#endif // #include guard
29