Commit 347e6eaf by Wenzel Jakob

allow a broader set of types in STL containers

parent 82ba3300
......@@ -27,7 +27,7 @@ NAMESPACE_BEGIN(detail)
template <typename Type, typename Key> struct set_caster {
typedef Type type;
typedef type_caster<Key> key_conv;
typedef type_caster<typename intrinsic_type<Key>::type> key_conv;
bool load(handle src, bool convert) {
pybind11::set s(src, true);
......@@ -58,8 +58,8 @@ template <typename Type, typename Key> struct set_caster {
template <typename Type, typename Key, typename Value> struct map_caster {
typedef Type type;
typedef type_caster<Key> key_conv;
typedef type_caster<Value> value_conv;
typedef type_caster<typename intrinsic_type<Key>::type> key_conv;
typedef type_caster<typename intrinsic_type<Value>::type> value_conv;
bool load(handle src, bool convert) {
dict d(src, true);
......@@ -94,7 +94,7 @@ template <typename Type, typename Key, typename Value> struct map_caster {
template <typename Type, typename Value> struct list_caster {
typedef Type type;
typedef type_caster<Value> value_conv;
typedef type_caster<typename intrinsic_type<Value>::type> value_conv;
bool load(handle src, bool convert) {
list l(src, true);
......@@ -139,7 +139,7 @@ template <typename Type, typename Alloc> struct type_caster<std::list<Type, Allo
template <typename Type, size_t Size> struct type_caster<std::array<Type, Size>> {
typedef std::array<Type, Size> array_type;
typedef type_caster<Type> value_conv;
typedef type_caster<typename intrinsic_type<Type>::type> value_conv;
bool load(handle src, bool convert) {
list l(src, true);
......
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