Skip to content

Conversation

@jagerman
Copy link
Member

@jagerman jagerman commented Dec 7, 2016

Fixes #544.

This abstracts the std::array support into an array_caster, then uses it for both std::array and std::valarray type casters.

Current the `_<bool>(a, b)` ternary support only works for `char[]` `a`
and `b`; this commit allows it to work for `descr` `a` and `b` arguments
as well.
This abstracts the std::array into a `array_caster` which can then be
used with either std::array or std::valarray, the main difference being
that std::valarray is resizable.  (It also lets the array_caster be
potentially used for other std::array-like interfaces, much as the
list_caster and map_caster currently provide).
- Remove redundant `type` typedefs
- make internal list_caster methods private
@wjakob
Copy link
Member

wjakob commented Dec 7, 2016

This looks good -- thank you!

@wjakob wjakob merged commit ae185b7 into pybind:master Dec 7, 2016
@darkdragon-001
Copy link

darkdragon-001 commented Aug 14, 2020

Should be added to STL containers > Automatic conversion documentation.

@YannickJadoul
Copy link
Collaborator

Thanks for noticing, @darkdragon-001. I've created a PR in #2547 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrap valarray

4 participants