mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-21 20:55:11 +00:00
added note about trailing commas (fixes #593)
This commit is contained in:
parent
ed8a461d9a
commit
ab26259c87
@ -230,6 +230,13 @@ override the ``name()`` method):
|
||||
std::string bark() override { PYBIND11_OVERLOAD(std::string, Dog, bark, ); }
|
||||
};
|
||||
|
||||
.. note::
|
||||
|
||||
Note the trailing commas in the ``PYBIND11_OVERLOAD`` calls to ``name()``
|
||||
and ``bark()``. These are needed to portably implement a trampoline for a
|
||||
function that does not take any arguments. For functions that take
|
||||
a nonzero number of arguments, the trailing comma must be omitted.
|
||||
|
||||
A registered class derived from a pybind11-registered class with virtual
|
||||
methods requires a similar trampoline class, *even if* it doesn't explicitly
|
||||
declare or override any virtual methods itself:
|
||||
|
Loading…
Reference in New Issue
Block a user