mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-21 20:55:11 +00:00
8756f16ed8
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/Lucas-C/pre-commit-hooks: v1.3.0 → v1.3.1](https://github.com/Lucas-C/pre-commit-hooks/compare/v1.3.0...v1.3.1) - [github.com/sirosen/texthooks: 0.3.1 → 0.4.0](https://github.com/sirosen/texthooks/compare/0.3.1...0.4.0) - [github.com/PyCQA/pylint: v2.14.5 → v2.15.0](https://github.com/PyCQA/pylint/compare/v2.14.5...v2.15.0) - [github.com/codespell-project/codespell: v2.1.0 → v2.2.1](https://github.com/codespell-project/codespell/compare/v2.1.0...v2.2.1) * Introduce .codespell-ignore-lines for safer (line-based instead of word-based) suppressions. * Fix two issues: 1. ensure sort order; 2. remove duplicates Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
25 lines
1.3 KiB
Plaintext
25 lines
1.3 KiB
Plaintext
template <op_id id, op_type ot, typename L = undefined_t, typename R = undefined_t>
|
|
template <typename ThisT>
|
|
auto &this_ = static_cast<ThisT &>(*this);
|
|
if (load_impl<ThisT>(temp, false)) {
|
|
ssize_t nd = 0;
|
|
auto trivial = broadcast(buffers, nd, shape);
|
|
auto ndim = (size_t) nd;
|
|
int nd;
|
|
ssize_t ndim() const { return detail::array_proxy(m_ptr)->nd; }
|
|
using op = op_impl<id, ot, Base, L_type, R_type>;
|
|
template <op_id id, op_type ot, typename L, typename R>
|
|
template <detail::op_id id, detail::op_type ot, typename L, typename R, typename... Extra>
|
|
class_ &def(const detail::op_<id, ot, L, R> &op, const Extra &...extra) {
|
|
class_ &def_cast(const detail::op_<id, ot, L, R> &op, const Extra &...extra) {
|
|
@pytest.mark.parametrize("access", ["ro", "rw", "static_ro", "static_rw"])
|
|
struct IntStruct {
|
|
explicit IntStruct(int v) : value(v){};
|
|
~IntStruct() { value = -value; }
|
|
IntStruct(const IntStruct &) = default;
|
|
IntStruct &operator=(const IntStruct &) = default;
|
|
py::class_<IntStruct>(m, "IntStruct").def(py::init([](const int i) { return IntStruct(i); }));
|
|
py::implicitly_convertible<int, IntStruct>();
|
|
m.def("test", [](int expected, const IntStruct &in) {
|
|
[](int expected, const IntStruct &in) {
|