[Boost-bugs] [Boost C++ Libraries] #7153: it is not possible to add methods in enum_ using def

Subject: [Boost-bugs] [Boost C++ Libraries] #7153: it is not possible to add methods in enum_ using def
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-07-20 08:36:17


#7153: it is not possible to add methods in enum_ using def
---------------------------------+------------------------------------------
 Reporter: tokiloki7@… | Owner: rwgk
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: Python
  Version: Boost 1.51.0 | Severity: Problem
 Keywords: |
---------------------------------+------------------------------------------
 Sometimes it is required to add method to exported enum to Python using
 Boost.Python. For example, if we want to specify __repr__ method to enum.
 But the following code wont work.

 enum_<my_enum>("my_enum")
             .def("__repr__", &my_enum_to_string)
             ;

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7153>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC