mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 13:15:12 +00:00
allow a broader set of types in STL containers
This commit is contained in:
parent
82ba330080
commit
347e6eaf68
@ -27,7 +27,7 @@ NAMESPACE_BEGIN(detail)
|
|||||||
|
|
||||||
template <typename Type, typename Key> struct set_caster {
|
template <typename Type, typename Key> struct set_caster {
|
||||||
typedef Type type;
|
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) {
|
bool load(handle src, bool convert) {
|
||||||
pybind11::set s(src, true);
|
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 {
|
template <typename Type, typename Key, typename Value> struct map_caster {
|
||||||
typedef Type type;
|
typedef Type type;
|
||||||
typedef type_caster<Key> key_conv;
|
typedef type_caster<typename intrinsic_type<Key>::type> key_conv;
|
||||||
typedef type_caster<Value> value_conv;
|
typedef type_caster<typename intrinsic_type<Value>::type> value_conv;
|
||||||
|
|
||||||
bool load(handle src, bool convert) {
|
bool load(handle src, bool convert) {
|
||||||
dict d(src, true);
|
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 {
|
template <typename Type, typename Value> struct list_caster {
|
||||||
typedef Type type;
|
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) {
|
bool load(handle src, bool convert) {
|
||||||
list l(src, true);
|
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>> {
|
template <typename Type, size_t Size> struct type_caster<std::array<Type, Size>> {
|
||||||
typedef std::array<Type, Size> array_type;
|
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) {
|
bool load(handle src, bool convert) {
|
||||||
list l(src, true);
|
list l(src, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user