16
16
TEST_SUBMODULE (buffers, m) {
17
17
m.attr (" long_double_and_double_have_same_size" ) = (sizeof (long double ) == sizeof (double ));
18
18
19
- m.def (" format_descriptor_format_buffer_info_compare " ,
19
+ m.def (" format_descriptor_format_buffer_info_equiv " ,
20
20
[](const std::string &cpp_name, const py::buffer &buffer) {
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
- static auto *compare_table
23
+ static auto *equiv_table
24
24
= new std::map<std::string, bool (*)(const py::buffer_info &)>;
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
- (*compare_table )[#__VA_ARGS__] = py::buffer_info::compare <__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 )
@@ -45,7 +45,7 @@ TEST_SUBMODULE(buffers, m) {
45
45
#undef PYBIND11_ASSIGN_HELPER
46
46
}
47
47
return std::pair<std::string, bool >((*format_table)[cpp_name],
48
- (*compare_table )[cpp_name](buffer.request ()));
48
+ (*equiv_table )[cpp_name](buffer.request ()));
49
49
});
50
50
51
51
// test_from_python / test_to_python:
0 commit comments