C++ Logo

std-proposals

Advanced search

[std-proposals] std::enum_max and std::enum_min

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Mon, 10 Jul 2023 08:15:04 +0100
Given the following enum:

enum MyEnum : int {
    eInvalid = 1,
    eFrog = 2,
    eGoat = 4,
    eFish = 8,
    eMonkey = 16,
};

I propose that:

    std::enum_max<MyEnum>

would evaluate to 16, and that:

    std::enum_min<MyEnum>

would evaluate to 1.

Received on 2023-07-10 07:15:17