Project

General

Profile

Actions

Task #3561

open

Add a FOO_MAX enumerator to all public enumerations

Added by Davide Pesavento over 8 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Base
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Tags:

Description

It is not currently possible to know if an arbitrary integer number is a valid value for a given enumeration. In some cases, even a simple static_cast of the integer to the enumeration type can invoke undefined behavior, so the "upper bound" of the enum must be known in advance. Having a _MAX enumerator also helps in validating user input.

Actions

Also available in: Atom PDF