Commit 93528f57 by Dean Moldovan

Document that type_caster requires default-constructible types

[skip ci]
parent 5f317e60
...@@ -78,6 +78,12 @@ type is explicitly allowed. ...@@ -78,6 +78,12 @@ type is explicitly allowed.
}; };
}} // namespace pybind11::detail }} // namespace pybind11::detail
.. note::
A ``type_caster<T>`` defined with ``PYBIND11_TYPE_CASTER(T, ...)`` requires
that ``T`` is default-constructible (``value`` is first default constructed
and then ``load()`` assigns to it).
.. warning:: .. warning::
When using custom type casters, it's important to declare them consistently When using custom type casters, it's important to declare them consistently
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment