- 12 Sep, 2017 1 commit
-
-
Dean Moldovan authored
E.g. trying to convert a `list` to a `std::vector<int>` without including <pybind11/stl.h> will now raise an error with a note that suggests checking the headers. The note is only appended if `std::` is found in the function signature. This should only be the case when a header is missing. E.g. when stl.h is included, the signature would contain `List[int]` instead of `std::vector<int>` while using stl_bind.h would produce something like `MyVector`. Similarly for `std::map`/`Dict`, `complex`, `std::function`/`Callable`, etc. There's a possibility for false positives, but it's pretty low.
-
- 10 Sep, 2017 3 commits
-
-
Dean Moldovan authored
Fixes #1075. `PyNumber_Float()` and `PyNumber_Long()` return new references.
-
Dean Moldovan authored
-
Dean Moldovan authored
To avoid an ODR violation in the test suite while testing both `stl.h` and `std_bind.h` with `std::vector<bool>`, the `py::bind_vector<std::vector<bool>>` test is moved to the secondary module (which does not include `stl.h`).
-
- 08 Sep, 2017 1 commit
-
-
Dean Moldovan authored
-
- 06 Sep, 2017 2 commits
-
-
Dean Moldovan authored
Fixes #1061. `T` and `const T &` are compatible types.
-
Dean Moldovan authored
-
- 31 Aug, 2017 2 commits
-
-
Wenzel Jakob authored
-
Wenzel Jakob authored
-
- 30 Aug, 2017 3 commits
-
-
Dean Moldovan authored
[skip ci]
-
Bruce Merry authored
There are two separate additions: 1. `py::hash(obj)` is equivalent to the Python `hash(obj)`. 2. `.def(hash(py::self))` registers the hash function defined by `std::hash<T>` as the Python hash function.
-
Dean Moldovan authored
This is analogous to `py::init()` vs `__init__` + placement-new. `py::pickle()` reuses most of the implementation details of `py::init()`.
-
- 28 Aug, 2017 1 commit
-
-
Wenzel Jakob authored
-
- 25 Aug, 2017 1 commit
-
-
Henry Schreiner authored
-
- 23 Aug, 2017 2 commits
-
-
Matthias Hochsteger authored
-
Wenzel Jakob authored
-
- 20 Aug, 2017 2 commits
-
-
Dean Moldovan authored
[skip ci]
-
Dean Moldovan authored
[skip ci]
-
- 07 Apr, 2017 1 commit
-
-
Wenzel Jakob authored
-
- 22 Mar, 2017 3 commits
-
-
Wenzel Jakob authored
-
Wenzel Jakob authored
-
Wenzel Jakob authored
-
- 06 Jan, 2017 1 commit
-
-
Wenzel Jakob authored
-
- 04 Jan, 2017 1 commit
-
-
Wenzel Jakob authored
-
- 01 Jan, 2017 1 commit
-
-
Wenzel Jakob authored
-
- 26 Dec, 2016 1 commit
-
-
Wenzel Jakob authored
-
- 23 Dec, 2016 2 commits
-
-
Wenzel Jakob authored
-
Wenzel Jakob authored
-
- 17 Nov, 2016 1 commit
-
-
Dean Moldovan authored
* Deprecate the `py::object::str()` member function since `py::str(obj)` is now equivalent and preferred * Make `py::repr()` a free function * Make sure obj.cast<T>() works as expected when T is a Python type `obj.cast<T>()` should be the same as `T(obj)`, i.e. it should convert the given object to a different Python type. However, `obj.cast<T>()` usually calls `type_caster::load()` which only checks the type without doing any actual conversion. That causes a very unexpected `cast_error`. This commit makes it so that `obj.cast<T>()` and `T(obj)` are the same when T is a Python type. * Simplify pytypes converting constructor implementation It's not necessary to maintain a full set of converting constructors and assignment operators + const& and &&. A single converting const& constructor will work and there is no impact on binary size. On the other hand, the conversion functions can be significantly simplified.
-
- 03 Nov, 2016 1 commit
-
-
Ivan Smirnov authored
* Add type caster for std::experimental::optional * Add tests for std::experimental::optional * Support both <optional> / <experimental/optional> * Mention std{::experimental,}::optional in the docs
-
- 01 Nov, 2016 1 commit
-
-
Dean Moldovan authored
* Make reference(_internal) the default return value policy for properties Before this, all `def_property*` functions used `automatic` as their default return value policy. This commit makes it so that: * Non-static properties use `reference_interal` by default, thus matching `def_readonly` and `def_readwrite`. * Static properties use `reference` by default, thus matching `def_readonly_static` and `def_readwrite_static`. In case `cpp_function` is passed to any `def_property*`, its policy will be used instead of any defaults. User-defined arguments in `extras` still have top priority and will override both the default policies and the ones from `cpp_function`. Resolves #436. * Almost always use return_value_policy::move for rvalues For functions which return rvalues or rvalue references, the only viable return value policies are `copy` and `move`. `reference(_internal)` and `take_ownership` would take the address of a temporary which is always an error. This commit prevents possible user errors by overriding the bad rvalue policies with `move`. Besides `move`, only `copy` is allowed, and only if it's explicitly selected by the user. This is also a necessary safety feature to support the new default return value policies for properties: `reference(_internal)`.
-
- 20 Oct, 2016 1 commit
-
-
Dean Moldovan authored
With this there is no more need for manual user declarations like `PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)`. Existing ones will still compile without error -- they will just be ignored silently. Resolves #446.
-
- 23 Sep, 2016 1 commit
-
-
Dean Moldovan authored
-
- 06 Sep, 2016 1 commit
-
-
Dean Moldovan authored
-
- 24 Aug, 2016 1 commit
-
-
Ivan Smirnov authored
-
- 14 Aug, 2016 1 commit
-
-
Ivan Smirnov authored
-
- 13 Aug, 2016 1 commit
-
-
Ivan Smirnov authored
-
- 12 Jul, 2016 1 commit
-
-
Wenzel Jakob authored
-
- 11 Jul, 2016 2 commits
-
-
Wenzel Jakob authored
-
Wenzel Jakob authored
-