Skip to content

Commit dabbbf3

Browse files
authored
fix: use OVERRIDE instead of OVERLOAD (#2490)
* fix: use OVERRIDE instead of OVERLOAD * docs: more accurate statement
1 parent 16f199f commit dabbbf3

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

docs/advanced/classes.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ Please take a look at the :ref:`macro_notes` before using this feature.
196196
The :c:macro:`PYBIND11_OVERRIDE` and accompanying macros used to be called
197197
``PYBIND11_OVERLOAD`` up until pybind11 v2.5.0, and :func:`get_override`
198198
used to be called ``get_overload``. This naming was corrected and the older
199-
macro and function names have been deprecated, in order to reduce confusion
200-
with overloaded functions and methods and ``py::overload_cast`` (see
201-
:ref:`classes`).
199+
macro and function names may soon be deprecated, in order to reduce
200+
confusion with overloaded functions and methods and ``py::overload_cast``
201+
(see :ref:`classes`).
202202

203203
.. seealso::
204204

tests/test_factory_constructors.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class PyTF6 : public TestFactory6 {
8989
PyTF6(const PyTF6 &f) : TestFactory6(f) { print_copy_created(this); }
9090
PyTF6(std::string s) : TestFactory6((int) s.size()) { alias = true; print_created(this, s); }
9191
~PyTF6() override { print_destroyed(this); }
92-
int get() override { PYBIND11_OVERLOAD(int, TestFactory6, get, /*no args*/); }
92+
int get() override { PYBIND11_OVERRIDE(int, TestFactory6, get, /*no args*/); }
9393
};
9494

9595
class TestFactory7 {
@@ -110,6 +110,7 @@ class PyTF7 : public TestFactory7 {
110110
PyTF7(PyTF7 &&f) : TestFactory7(std::move(f)) { print_move_created(this); }
111111
PyTF7(const PyTF7 &f) : TestFactory7(f) { print_copy_created(this); }
112112
~PyTF7() override { print_destroyed(this); }
113+
int get() override { PYBIND11_OVERRIDE(int, TestFactory7, get, /*no args*/); }
113114
};
114115

115116

tests/test_virtual_functions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ struct Base {
159159

160160
struct DispatchIssue : Base {
161161
std::string dispatch() const override {
162-
PYBIND11_OVERLOAD_PURE(std::string, Base, dispatch, /* no arguments */);
162+
PYBIND11_OVERRIDE_PURE(std::string, Base, dispatch, /* no arguments */);
163163
}
164164
};
165165

0 commit comments

Comments
 (0)