/template_pybind_example

Some experimentation with pybind and templated C++ code

Primary LanguagePythonOtherNOASSERTION

Experimental Code for C++ templates and pybind11

Some experimentation with pybind and templated C++ code. This code has been modified from pybind's cmake example. In contrast to their example, a C++14 compatible compiler is required for this repo.

The idea is to figure out a clean general and reusable way of binding class template realizations using convenience functions, see this stackoverflow question.

Installation

Just clone this repository and pip install. Note the --recursive option which is needed for the pybind11 submodule:

git clone --recursive https://github.com/joergbrech/template_pybind_example
pip install ./template_pybind_example

With the setup.py file included in this example, the pip install command will invoke CMake and build the pybind11 module as specified in CMakeLists.txt.