Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pybind11_abseil/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pybind_library(
"@com_google_absl//absl/container:btree",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/container:inlined_vector",
"@com_google_absl//absl/container:node_hash_map",
"@com_google_absl//absl/container:node_hash_set",
"@com_google_absl//absl/strings",
Expand Down
7 changes: 7 additions & 0 deletions pybind11_abseil/absl_casters.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
// - absl::flat_hash_map- converts to/from python dict.
// - absl::flat_hash_set- converst to/from python set.
// - absl::btree_map- converts to/from python dict.
// - absl::InlinedVector- converts to/from python list.
//
// For details, see the README.md.
//
Expand Down Expand Up @@ -51,6 +52,7 @@
#include "absl/container/btree_map.h"
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/container/inlined_vector.h"
#include "absl/container/node_hash_map.h"
#include "absl/container/node_hash_set.h"
#include "absl/strings/cord.h"
Expand Down Expand Up @@ -598,6 +600,11 @@ template <typename Key, typename Hash, typename Equal, typename Alloc>
struct type_caster<absl::node_hash_set<Key, Hash, Equal, Alloc>>
: set_caster<absl::node_hash_set<Key, Hash, Equal, Alloc>, Key> {};

// Convert between absl::InlinedVector and python list.
template <typename T, size_t N, typename A>
struct type_caster<absl::InlinedVector<T, N, A>>
: list_caster<absl::InlinedVector<T, N, A>, T> {};

// Convert between absl::string_view and python.
//
// pybind11 supports std::string_view, and absl::string_view is meant to be a
Expand Down
Loading