You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once upon a time, adding py::arithmetic() to an enum class defined the bitwise complement operator (aka ~, aka __invert__). It looks like that went away in #1511. Was this intentional or a regression? If the former, please just close. I included a code snippet that reactivates the operator downstream, in case others run across the problem.
Reproducible example code
If one adds an invert line (~m.Flags.Write) to the test_enum.py test case (to an enum with arithmetic enabled, it throws an error
Issue description
Once upon a time, adding
py::arithmetic()
to an enum class defined the bitwise complement operator (aka~
, aka__invert__
). It looks like that went away in #1511. Was this intentional or a regression? If the former, please just close. I included a code snippet that reactivates the operator downstream, in case others run across the problem.Reproducible example code
If one adds an invert line (
~m.Flags.Write
) to thetest_enum.py
test case (to an enum with arithmetic enabled, it throws an errorUser code solution
In case anyone needs this capability, this is a fix for your own code. (The
def
must be after theexport_values
.)The text was updated successfully, but these errors were encountered: