This adds automatic casting when assigning to python types like dict,
list, and attributes. Instead of:
dict["key"] = py::cast(val);
m.attr("foo") = py::cast(true);
list.append(py::cast(42));
you can now simply write:
dict["key"] = val;
m.attr("foo") = true;
list.append(42);
Casts needing extra parameters (e.g. for a non-default rvp) still
require the py::cast() call. set::add() is also supported.
All usage is channeled through a SFINAE implementation which either just returns or casts.
Combined non-converting handle and autocasting template methods via a
helper method that either just returns (handle) or casts (C++ type).
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| _static | Loading commit data... | |
| advanced | Loading commit data... | |
| Makefile | Loading commit data... | |
| basics.rst | Loading commit data... | |
| benchmark.py | Loading commit data... | |
| benchmark.rst | Loading commit data... | |
| changelog.rst | Loading commit data... | |
| classes.rst | Loading commit data... | |
| compiling.rst | Loading commit data... | |
| conf.py | Loading commit data... | |
| faq.rst | Loading commit data... | |
| index.rst | Loading commit data... | |
| intro.rst | Loading commit data... | |
| limitations.rst | Loading commit data... | |
| pybind11-logo.png | Loading commit data... | |
| pybind11_vs_boost_python1.png | Loading commit data... | |
| pybind11_vs_boost_python1.svg | Loading commit data... | |
| pybind11_vs_boost_python2.png | Loading commit data... | |
| pybind11_vs_boost_python2.svg | Loading commit data... | |
| reference.rst | Loading commit data... | |
| release.rst | Loading commit data... |