Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
ab26259c
Commit
ab26259c
authored
Mar 22, 2017
by
Wenzel Jakob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added note about trailing commas (fixes #593)
parent
ed8a461d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
docs/advanced/classes.rst
+7
-0
No files found.
docs/advanced/classes.rst
View file @
ab26259c
...
@@ -230,6 +230,13 @@ override the ``name()`` method):
...
@@ -230,6 +230,13 @@ override the ``name()`` method):
std::string bark() override { PYBIND11_OVERLOAD(std::string, Dog, bark, ); }
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
A registered class derived from a pybind11-registered class with virtual
methods requires a similar trampoline class, *even if* it doesn't explicitly
methods requires a similar trampoline class, *even if* it doesn't explicitly
declare or override any virtual methods itself:
declare or override any virtual methods itself:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment