Add test for mixing STL casters and local binders across modules

One module uses a generic vector caster from `<pybind11/stl.h>` while
the other exports `std::vector<int>` with a local `py:bind_vector`.
This commit is contained in:
Dean Moldovan
2017-08-13 03:03:06 +02:00
parent eb0f1cc7bf
commit 8d3cedbe2b
4 changed files with 66 additions and 17 deletions

View File

@@ -21,6 +21,14 @@ using MixedLocalGlobal = LocalBase<4>;
/// Mixed: global first, then local (which fails)
using MixedGlobalLocal = LocalBase<5>;
using LocalVec = std::vector<LocalType>;
using LocalVec2 = std::vector<NonLocal2>;
using LocalMap = std::unordered_map<std::string, LocalType>;
using NonLocalVec = std::vector<NonLocalType>;
using NonLocalVec2 = std::vector<NonLocal2>;
using NonLocalMap = std::unordered_map<std::string, NonLocalType>;
using NonLocalMap2 = std::unordered_map<std::string, uint8_t>;
// Simple bindings (used with the above):
template <typename T, int Adjust, typename... Args>
py::class_<T> bind_local(Args && ...args) {