Automatic conversion between C++ and Python types

Introduction

Boost.Python allows to define automatic conversion from\to C++\Python types. While this is very, very useful functionality, the documentation for it does not exist. This example will shed some light on “r-value”\”l-value” converters.

Content

This example actually consist from 2 small, well documented examples.

The first one shows how to handle conversion between tuples: boost::tuples::tuple and Python tuple.

The second one shows how to add an automatic conversion from Python tuple to some registered class. The class registration allows you to use its functionality and enjoy from automatic conversion.

blog comments powered by Disqus

Table Of Contents

Previous topic

Boost.Python library patch

Next topic

Boost.Python to/from Python tuple conversion

This Page