...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
arg
arg
synopsisarg
constructorarg
template
operator =
,
args(
...)
Supplies a family of overloaded functions for specifying argument keywords for wrapped C++ functions.
A keyword-expression results in an object which holds a sequence of ntbses, 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
class arg;
The objects of class arg are keyword-expressions holding one keyword ( size one )
arg
synopsisnamespace boost { namespace python { struct arg { template <class T> arg &operator = (T const &value); explicit arg (char const *name){elements[0].name = name;} }; }}
arg
constructorarg(char const* name);
arg
object holding a
keyword with name name
.arg
operator =template <class T> arg &operator = (T const &value);
this
.,
keyword-expression operator , (keyword-expression, const arg &kw) const keyword-expression operator , (keyword-expression, const char *name) const;
name
must be a ntbs.args(
...)
unspecified1 args(char const*); unspecified2 args(char const*, char const*); . . . unspecifiedN args(char const*, char const*, ... char const*);
#include <boost/python/def.hpp> using namespace boost::python; int f(double x, double y, double z=0.0, double w=1.0); BOOST_PYTHON_MODULE(xxx) { def("f", f , ( arg("x"), "y", arg("z")=0.0, arg("w")=1.0 ) ); }
Revised 01 August, 2003
© Copyright Dave Abrahams 2002-2003.