Enum can be passed only by right reference

enums are constants so you can’t take it as n1::e1& but as const n1::e1&:

void f(const n1::e1& e) {
    std::cout<<static_cast<int>(e);
}

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top