Make TypeErrors more informative when an optional header is missing
E.g. trying to convert a `list` to a `std::vector<int>` without
including <pybind11/stl.h> will now raise an error with a note that
suggests checking the headers.
The note is only appended if `std::` is found in the function
signature. This should only be the case when a header is missing.
E.g. when stl.h is included, the signature would contain `List[int]`
instead of `std::vector<int>` while using stl_bind.h would produce
something like `MyVector`. Similarly for `std::map`/`Dict`, `complex`,
`std::function`/`Callable`, etc.
There's a possibility for false positives, but it's pretty low.
diff --git a/docs/changelog.rst b/docs/changelog.rst
index eea15d5..1015f0c 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -35,6 +35,10 @@
that's only registered in an external module.
`#1058 <https://github.com/pybind/pybind11/pull/1058>`_.
+* Conversion errors now try to be more informative when it's likely that
+ a missing header is the cause (e.g. forgetting ``<pybind11/stl.h>``).
+ `#1077 <https://github.com/pybind/pybind11/pull/1077>`_.
+
v2.2.0 (August 31, 2017)
-----------------------------------------------------