Skip to content

Support for C++ scoped enum class #1603

@TheJJ

Description

@TheJJ

There is currently no sane way to represent enum class in .pxd.

namespace lol {
enum class rofl : int {
    SOMETHING,
    MOAR = 1337
};

// at this point, accessible as rofl::MOAR
}
// here, accessible as lol::rofl::MOAR

A possible way of representing it would be:

cdef extern from "headername.h" namespace "lol":
    cdef enumclass rofl:
        SOMETHING
        MOAR

# accessed as
rofl.MOAR

Related: #1567

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions