aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/pybind11/tests/test_opaque_types.cpp
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2022-09-14 09:28:47 +0200
committergatecat <gatecat@ds0.me>2022-09-14 09:28:47 +0200
commita72f898ff4c4237424c468044a6db9d6953b541e (patch)
tree1c4a543f661dd1b281aecf4660388491702fa8d8 /3rdparty/pybind11/tests/test_opaque_types.cpp
parentf1349e114f3a16ccd002e8513339e18f5be4d31b (diff)
downloadnextpnr-a72f898ff4c4237424c468044a6db9d6953b541e.tar.gz
nextpnr-a72f898ff4c4237424c468044a6db9d6953b541e.tar.bz2
nextpnr-a72f898ff4c4237424c468044a6db9d6953b541e.zip
3rdparty: Bump vendored pybind11 version for py3.11 support
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to '3rdparty/pybind11/tests/test_opaque_types.cpp')
-rw-r--r--3rdparty/pybind11/tests/test_opaque_types.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/3rdparty/pybind11/tests/test_opaque_types.cpp b/3rdparty/pybind11/tests/test_opaque_types.cpp
index 5a234316..0386dba0 100644
--- a/3rdparty/pybind11/tests/test_opaque_types.cpp
+++ b/3rdparty/pybind11/tests/test_opaque_types.cpp
@@ -7,8 +7,10 @@
BSD-style license that can be found in the LICENSE file.
*/
-#include "pybind11_tests.h"
#include <pybind11/stl.h>
+
+#include "pybind11_tests.h"
+
#include <vector>
// IMPORTANT: Disable internal pybind11 translation mechanisms for STL data structures
@@ -26,12 +28,13 @@ TEST_SUBMODULE(opaque_types, m) {
.def(py::init<>())
.def("pop_back", &StringList::pop_back)
/* There are multiple versions of push_back(), etc. Select the right ones. */
- .def("push_back", (void (StringList::*)(const std::string &)) &StringList::push_back)
- .def("back", (std::string &(StringList::*)()) &StringList::back)
+ .def("push_back", (void(StringList::*)(const std::string &)) & StringList::push_back)
+ .def("back", (std::string & (StringList::*) ()) & StringList::back)
.def("__len__", [](const StringList &v) { return v.size(); })
- .def("__iter__", [](StringList &v) {
- return py::make_iterator(v.begin(), v.end());
- }, py::keep_alive<0, 1>());
+ .def(
+ "__iter__",
+ [](StringList &v) { return py::make_iterator(v.begin(), v.end()); },
+ py::keep_alive<0, 1>());
class ClassWithSTLVecProperty {
public:
@@ -44,9 +47,10 @@ TEST_SUBMODULE(opaque_types, m) {
m.def("print_opaque_list", [](const StringList &l) {
std::string ret = "Opaque list: [";
bool first = true;
- for (auto entry : l) {
- if (!first)
+ for (const auto &entry : l) {
+ if (!first) {
ret += ", ";
+ }
ret += entry;
first = false;
}