| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| attr.h | ||
| cast.h | ||
| chrono.h | ||
| common.h | ||
| complex.h | ||
| descr.h | ||
| eigen.h | ||
| eval.h | ||
| functional.h | ||
| numpy.h | ||
| operators.h | ||
| options.h | ||
| pybind11.h | ||
| pytypes.h | ||
| stl.h | ||
| stl_bind.h | ||
| typeid.h |
When compiling in C++17 mode the noexcept specifier is part of the function type. This causes a failure in pybind11 because, by omitting a noexcept specifier when deducing function return and argument types, we are implicitly making `noexcept(false)` part of the type. This means that functions with `noexcept` fail to match the function templates in cpp_function (and other places), and we get compilation failure (we end up trying to fit it into the lambda function version, which fails since a function pointer has no `operator()`). We can, however, deduce the true/false `B` in noexcept(B), so we don't need to add a whole other set of overloads, but need to deduce the extra argument when under C++17. That will *not* work under pre-C++17, however. This commit adds two macros to fix the problem: under C++17 (with the appropriate feature macro set) they provide an extra `bool NoExceptions` template argument and provide the `noexcept(NoExceptions)` deduced specifier. Under pre-C++17 they expand to nothing. This is needed to compile pybind11 with gcc7 under -std=c++17.
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| attr.h | Loading commit data... | |
| cast.h | Loading commit data... | |
| chrono.h | Loading commit data... | |
| common.h | Loading commit data... | |
| complex.h | Loading commit data... | |
| descr.h | Loading commit data... | |
| eigen.h | Loading commit data... | |
| eval.h | Loading commit data... | |
| functional.h | Loading commit data... | |
| numpy.h | Loading commit data... | |
| operators.h | Loading commit data... | |
| options.h | Loading commit data... | |
| pybind11.h | Loading commit data... | |
| pytypes.h | Loading commit data... | |
| stl.h | Loading commit data... | |
| stl_bind.h | Loading commit data... | |
| typeid.h | Loading commit data... |