Adds type_caster support for std::deque. (#1609)

* Adds std::deque to the types supported by list_caster in stl.h.
* Adds a new test_deque test in test_stl.{py,cpp}.
* Updates the documentation to include std::deque as a default
  supported type.
This commit is contained in:
voxmea
2018-11-16 00:45:19 -05:00
committed by Wenzel Jakob
parent 8f5b7fce84
commit 17983e7425
4 changed files with 18 additions and 1 deletions

View File

@@ -16,6 +16,7 @@
#include <unordered_map>
#include <iostream>
#include <list>
#include <deque>
#include <valarray>
#if defined(_MSC_VER)
@@ -185,6 +186,9 @@ public:
template <typename Type, typename Alloc> struct type_caster<std::vector<Type, Alloc>>
: list_caster<std::vector<Type, Alloc>, Type> { };
template <typename Type, typename Alloc> struct type_caster<std::deque<Type, Alloc>>
: list_caster<std::deque<Type, Alloc>, Type> { };
template <typename Type, typename Alloc> struct type_caster<std::list<Type, Alloc>>
: list_caster<std::list<Type, Alloc>, Type> { };