summaryrefslogtreecommitdiff
path: root/ext/pybind11/docs/classes.rst
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2017-05-09 19:22:53 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2017-05-22 17:15:09 +0000
commit6914a229a038206341ae1fea46393965a555ca9a (patch)
tree4a11cfaed46dabc827c5ee17cd976f42b5f53d49 /ext/pybind11/docs/classes.rst
parentca1d18d599dcc620bf526fb22042af95b1b60b68 (diff)
downloadgem5-6914a229a038206341ae1fea46393965a555ca9a.tar.xz
ext: Upgrade PyBind11 to version 2.1.1
Change-Id: I16870dec402d661295f9d013dc23e362b2b2c169 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> Reviewed-on: https://gem5-review.googlesource.com/3225 Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'ext/pybind11/docs/classes.rst')
-rw-r--r--ext/pybind11/docs/classes.rst12
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/pybind11/docs/classes.rst b/ext/pybind11/docs/classes.rst
index 872977684..30fb2a2d5 100644
--- a/ext/pybind11/docs/classes.rst
+++ b/ext/pybind11/docs/classes.rst
@@ -38,7 +38,7 @@ The binding code for ``Pet`` looks as follows:
return m.ptr();
}
-:class:`class_` creates bindings for a C++ `class` or `struct`-style data
+:class:`class_` creates bindings for a C++ *class* or *struct*-style data
structure. :func:`init` is a convenience function that takes the types of a
constructor's parameters as template arguments and wraps the corresponding
constructor (see the :ref:`custom_constructors` section for details). An
@@ -298,8 +298,8 @@ different kinds of input arguments:
struct Pet {
Pet(const std::string &name, int age) : name(name), age(age) { }
- void set(int age) { age = age; }
- void set(const std::string &name) { name = name; }
+ void set(int age_) { age = age_; }
+ void set(const std::string &name_) { name = name_; }
std::string name;
int age;
@@ -423,6 +423,12 @@ typed enums.
>>> int(p.type)
1L
+The entries defined by the enumeration type are exposed in the ``__members__`` property:
+
+.. code-block:: pycon
+
+ >>> Pet.Kind.__members__
+ {'Dog': Kind.Dog, 'Cat': Kind.Cat}
.. note::