Skip to content

Commit 205e982

Browse files
committed
Add conversion from enum_<> to class_<>
1 parent d34d378 commit 205e982

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/pybind11/pybind11.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,10 @@ template <typename Type> class enum_ {
12611261
return cls;
12621262
}
12631263

1264+
operator class_<Type>() && {
1265+
return into_class();
1266+
}
1267+
12641268
private:
12651269
class_<Type> cls;
12661270
dict m_entries;

0 commit comments

Comments
 (0)