Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

init.hpp

Introduction
init-expressions
Class template init
Class template init constructors
Class template init observer functions
Class template optional
Example

<boost/python/init.hpp> defines the interface for exposing C++ constructors to Python as extension class __init__ functions.

An init-expression is used to describe a family of __init__ methods to be generated for an extension class, and the result has the following properties:

docstring

An ntbs whose value will bound to the method's __doc__ attribute

keywords

A keyword-expression which will be used to name (a trailing subsequence of) the arguments to the generated __init__ function(s).

call_policies

An instance of a model of CallPolicies.

argument_types

An MPL sequence of C++ argument types which will be used to construct the wrapped C++ object. An init expression has one or more valid prefixes which are given by a sequence of prefixes of its argument types.


PrevUpHomeNext