2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 18:12:43 +00:00

enum export

[SVN r16604]
This commit is contained in:
Dave Abrahams
2002-12-13 20:04:34 +00:00
parent eab084c9a2
commit 4a5817d8ba
7 changed files with 39 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ BOOST_PYTHON_MODULE(enum_ext)
.value("red", red)
.value("green", green)
.value("blue", blue)
.export_values()
;
def("identity", identity_);

View File

@@ -20,6 +20,17 @@ enum_ext.color.green
enum_ext.color(3)
>>> identity(color(4))
enum_ext.color.blue
--- check export to scope ---
>>> identity(red)
enum_ext.color.red
>>> identity(green)
enum_ext.color.green
>>> identity(blue)
enum_ext.color.blue
>>> try: identity(1)