summaryrefslogtreecommitdiff
path: root/ext/pybind11/docs/advanced/cast/custom.rst
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pybind11/docs/advanced/cast/custom.rst')
-rw-r--r--ext/pybind11/docs/advanced/cast/custom.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/pybind11/docs/advanced/cast/custom.rst b/ext/pybind11/docs/advanced/cast/custom.rst
index c854e7fcd..e4f99ac5b 100644
--- a/ext/pybind11/docs/advanced/cast/custom.rst
+++ b/ext/pybind11/docs/advanced/cast/custom.rst
@@ -78,6 +78,12 @@ type is explicitly allowed.
};
}} // 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::
When using custom type casters, it's important to declare them consistently