Skip to content

fix: use OVERRIDE instead of OVERLOAD #2490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/advanced/classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ Please take a look at the :ref:`macro_notes` before using this feature.
The :c:macro:`PYBIND11_OVERRIDE` and accompanying macros used to be called
``PYBIND11_OVERLOAD`` up until pybind11 v2.5.0, and :func:`get_override`
used to be called ``get_overload``. This naming was corrected and the older
macro and function names have been deprecated, in order to reduce confusion
with overloaded functions and methods and ``py::overload_cast`` (see
:ref:`classes`).
macro and function names may soon be deprecated, in order to reduce
confusion with overloaded functions and methods and ``py::overload_cast``
(see :ref:`classes`).

.. seealso::

Expand Down
3 changes: 2 additions & 1 deletion tests/test_factory_constructors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class PyTF6 : public TestFactory6 {
PyTF6(const PyTF6 &f) : TestFactory6(f) { print_copy_created(this); }
PyTF6(std::string s) : TestFactory6((int) s.size()) { alias = true; print_created(this, s); }
~PyTF6() override { print_destroyed(this); }
int get() override { PYBIND11_OVERLOAD(int, TestFactory6, get, /*no args*/); }
int get() override { PYBIND11_OVERRIDE(int, TestFactory6, get, /*no args*/); }
};

class TestFactory7 {
Expand All @@ -110,6 +110,7 @@ class PyTF7 : public TestFactory7 {
PyTF7(PyTF7 &&f) : TestFactory7(std::move(f)) { print_move_created(this); }
PyTF7(const PyTF7 &f) : TestFactory7(f) { print_copy_created(this); }
~PyTF7() override { print_destroyed(this); }
int get() override { PYBIND11_OVERRIDE(int, TestFactory7, get, /*no args*/); }
};


Expand Down
2 changes: 1 addition & 1 deletion tests/test_virtual_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ struct Base {

struct DispatchIssue : Base {
std::string dispatch() const override {
PYBIND11_OVERLOAD_PURE(std::string, Base, dispatch, /* no arguments */);
PYBIND11_OVERRIDE_PURE(std::string, Base, dispatch, /* no arguments */);
}
};

Expand Down