forked from boostorg/functional
Updated docs.
[SVN r77899]
This commit is contained in:
@@ -9,10 +9,14 @@
|
||||
#define IDENTITY_HPP_
|
||||
|
||||
#include <boost/function.hpp>
|
||||
//[identity_typeof
|
||||
#include <boost/typeof/std/string.hpp> // No need to register `boost::function`.
|
||||
//]
|
||||
#include <string>
|
||||
|
||||
//[identity_decls
|
||||
const std::string& identity_s(const std::string& x) { return x; } // As pointer.
|
||||
const std::string& identity_s(const std::string& x) // Function (as pointer).
|
||||
{ return x; }
|
||||
|
||||
int identity_i_impl(int x) { return x; }
|
||||
int (&identity_i)(int) = identity_i_impl; // Function reference.
|
||||
|
||||
@@ -7,12 +7,11 @@
|
||||
|
||||
#include "identity.hpp"
|
||||
#include <boost/functional/overloaded_function.hpp>
|
||||
#include <boost/typeof/typeof.hpp> // For `BOOST_AUTO`.
|
||||
#include <boost/typeof/std/string.hpp> // No need to register `boost::function`.
|
||||
#include <boost/typeof/typeof.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
int main() {
|
||||
//[identity_make
|
||||
//[identity_make_decl
|
||||
BOOST_AUTO(identity, boost::make_overloaded_function(
|
||||
identity_s, identity_i, identity_d));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user