From bb4dd8289b351fae6b55e303f189127a394a1edd Mon Sep 17 00:00:00 2001
From: Anas Nashif
// write "thin wrappers"
-int f1(int x) { f(x); }
-int f2(int x, double y) { f(x,y); }
+int f1(int x) { return f(x); }
+int f2(int x, double y) { return f(x,y); }
/*...*/
diff --git a/libs/python/doc/tutorial/doc/tutorial.qbk b/libs/python/doc/tutorial/doc/tutorial.qbk
index 204c500449..10a452200c 100644
--- a/libs/python/doc/tutorial/doc/tutorial.qbk
+++ b/libs/python/doc/tutorial/doc/tutorial.qbk
@@ -901,8 +901,8 @@ wrapping as outlined in the [link python.overloading previous section], or
writing thin wrappers:
// write "thin wrappers"
- int f1(int x) { f(x); }
- int f2(int x, double y) { f(x,y); }
+ int f1(int x) { return f(x); }
+ int f2(int x, double y) { return f(x,y); }
/*...*/
diff --git a/libs/python/doc/v2/make_function.html b/libs/python/doc/v2/make_function.html
index 3913672195..d5a6cdb06e 100644
--- a/libs/python/doc/v2/make_function.html
+++ b/libs/python/doc/v2/make_function.html
@@ -96,10 +96,10 @@ template <class F, class Policies, class Keywords, class Signature>
to f
.
policies
are supplied, it
will be applied to the function as described here.
+ "CallPolicies.html">here.
keywords
are
supplied, the keywords will be applied in order to the final
- arguments of the resulting function.
+ arguments of the resulting function.
Signature
is supplied, it should be an instance of an MPL front-extensible
@@ -125,36 +125,33 @@ template <class F, class Policies, class Keywords, class Signature>
-template <class T, class ArgList, class Generator> -object make_constructor(); - -template <class ArgList, class Generator, class Policies> +template <class F> +object make_constructor(F f) + +template <class F, class Policies> +object make_constructor(F f, Policies const& policies) + +template <class F, class Policies, class KeywordsOrSignature> +object make_constructor(F f, Policies const& policies, KeywordsOrSignature const& ks) + +template <class F, class Policies, class Keywords, class Signature> object make_constructor(Policies const& policies) +"object.html#object-spec">objectmake_constructor(F f, Policies const& policies, Keywords const& kw, Signature const& sig)
T
is a class type.
- Policies
is a model of CallPolicies. ArgList
is an MPL sequence of C++ argument
- types (A1, A2,... AN) such that if
- a1, a2
... aN
are objects of type
- A1, A2,... AN respectively, the expression new
- Generator::apply<T>::type(a1, a2
... aN
)
- is valid. Generator is a model of HolderGenerator.F
is a
+ function pointer type. If policies
are supplied, it must
+ be a model of CallPolicies. If
+ kewords
are supplied, it must be the result of a keyword-expression
+ specifying no more arguments than the arity of f
.Generator::apply<T>::type
object, which is then
- installed in the extension class object. In the second form, the
- policies
are applied to the arguments and result (None)
- of the Python callable objectf
.
>>> from make_function_test import * >>> f = choose_function(1) -- cgit v1.2.3