pybind11/docs
Jason Rhinelander 5fffe200e3 Allow arbitrary class_ template option ordering
The current pybind11::class_<Type, Holder, Trampoline> fixed template
ordering results in a requirement to repeat the Holder with its default
value (std::unique_ptr<Type>) argument, which is a little bit annoying:
it needs to be specified not because we want to override the default,
but rather because we need to specify the third argument.

This commit removes this limitation by making the class_ template take
the type name plus a parameter pack of options.  It then extracts the
first valid holder type and the first subclass type for holder_type and
trampoline type_alias, respectively.  (If unfound, both fall back to
their current defaults, `std::unique_ptr<type>` and `type`,
respectively).  If any unmatched template arguments are provided, a
static assertion fails.

What this means is that you can specify or omit the arguments in any
order:

    py::class_<A, PyA> c1(m, "A");
    py::class_<B, PyB, std::shared_ptr<B>> c2(m, "B");
    py::class_<C, std::shared_ptr<C>, PyB> c3(m, "C");

It also allows future class attributes (such as base types in the next
commit) to be passed as class template types rather than needing to use
a py::base<> wrapper.
2016-09-06 12:22:13 -04:00
..
_static documentation improvements 2016-04-26 23:48:55 +02:00
Makefile took a stab at some documentation 2015-10-13 03:16:44 +02:00
advanced.rst Allow arbitrary class_ template option ordering 2016-09-06 12:22:13 -04:00
basics.rst basics.rst: minor table update for Eigen types 2016-09-06 14:13:35 +09:00
benchmark.py Much more efficient generation of function signatures, updated docs 2016-01-17 22:31:15 +01:00
benchmark.rst ..mention in benchmark docs as well 2016-08-19 09:38:14 +02:00
changelog.rst Document calling function with keyword arguments from C++ 2016-09-06 16:41:50 +02:00
classes.rst clarification on static properties (fixes #248) 2016-06-22 13:52:31 +02:00
compiling.rst minor doc & style fixes 2016-09-06 13:02:29 +09:00
conf.py Fix sphinx doc missing code blocks and warnings 2016-08-16 01:30:58 +02:00
faq.rst minor doc & style fixes 2016-09-06 13:02:29 +09:00
index.rst minor FAQ edits, referenced cppimport project 2016-05-17 10:47:52 +02:00
intro.rst ..mention in benchmark docs as well 2016-08-19 09:38:14 +02:00
limitations.rst updated limitations section 2016-06-30 14:46:11 +02:00
pybind11-logo.png Very minor documentation fixes, updated logo 2016-01-17 22:31:15 +01:00
pybind11_vs_boost_python1.png documentation improvements 2016-04-28 15:32:07 +02:00
pybind11_vs_boost_python1.svg Much more efficient generation of function signatures, updated docs 2016-01-17 22:31:15 +01:00
pybind11_vs_boost_python2.png documentation improvements 2016-04-28 15:32:07 +02:00
pybind11_vs_boost_python2.svg Much more efficient generation of function signatures, updated docs 2016-01-17 22:31:15 +01:00
reference.rst complete rewrite of eval/exec patch 2016-07-08 10:52:10 +02:00
release.rst updated changelog with v1.8.1, updated release instructions 2016-07-12 18:03:17 +02:00