1 [section boost/python/args.hpp]
3 Supplies a family of overloaded functions for specifying argument keywords for wrapped C++ functions.
4 [section keyword-expressions]
5 A keyword-expression results in an object which holds a sequence of [link ntbs]\ es, and whose type encodes the number of keywords specified. The keyword-expression may contain default values for some or all of the keywords it holds
9 The objects of class arg are keyword-expressions holding one keyword ( size one )
11 namespace boost { namespace python
16 arg &operator = (T const &value);
17 explicit arg (char const *name){elements[0].name = name;}
23 [section Class `arg` constructor]
24 ``arg(char const* name);``
26 [[Requires][The argument must be a [link ntbs].]]
27 [[Effects][Constructs an arg object holding a keyword with name name.]]
30 [section Class `arg` operator=]
31 ``template <class T> arg &operator = (T const &value);``
33 [[Requires][The argument must convertible to python.]]
34 [[Effects][Assigns default value for the keyword.]]
35 [[Returns][Reference to `this`.]]
38 [section Keyword-expression operator,]
40 keyword-expression operator , (keyword-expression, const arg &kw) const
41 keyword-expression operator , (keyword-expression, const char *name) const;
44 [[Requires][The argument name must be a [link ntbs].]]
45 [[Effects][Extends the keyword-expression argument with one more keyword.]]
46 [[Returns][The extended keyword-expression.]]
51 #include <boost/python/def.hpp>
52 using namespace boost::python;
54 int f(double x, double y, double z=0.0, double w=1.0);
56 BOOST_PYTHON_MODULE(xxx)
58 def("f", f, (arg("x"), "y", arg("z")=0.0, arg("w")=1.0));