@@ -21,11 +21,11 @@ TEST_SUBMODULE(buffers, m) {
21
21
// https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables
22
22
static auto *format_table = new std::map<std::string, std::string>;
23
23
static auto *equiv_table
24
- = new std::map<std::string, bool (*)( const py::buffer_info &) >;
24
+ = new std::map<std::string, bool (py::buffer_info::*)() const >;
25
25
if (format_table->empty ()) {
26
26
#define PYBIND11_ASSIGN_HELPER (...) \
27
27
(*format_table)[#__VA_ARGS__] = py::format_descriptor<__VA_ARGS__>::format (); \
28
- (*equiv_table)[#__VA_ARGS__] = py::buffer_info::item_type_is_equivalent_to<__VA_ARGS__>;
28
+ (*equiv_table)[#__VA_ARGS__] = & py::buffer_info::item_type_is_equivalent_to<__VA_ARGS__>;
29
29
PYBIND11_ASSIGN_HELPER (PyObject *)
30
30
PYBIND11_ASSIGN_HELPER (bool )
31
31
PYBIND11_ASSIGN_HELPER (std::int8_t )
@@ -44,8 +44,8 @@ TEST_SUBMODULE(buffers, m) {
44
44
PYBIND11_ASSIGN_HELPER (std::complex<long double >)
45
45
#undef PYBIND11_ASSIGN_HELPER
46
46
}
47
- return std::pair<std::string, bool >((*format_table)[cpp_name],
48
- (*equiv_table )[cpp_name](buffer.request ()));
47
+ return std::pair<std::string, bool >(
48
+ (*format_table )[cpp_name], (buffer.request ().*((*equiv_table)[cpp_name]))( ));
49
49
});
50
50
51
51
// test_from_python / test_to_python:
0 commit comments