GabrielDosReis / ipr

Compiler-neutral Internal Program Representation for C++
BSD 3-Clause "New" or "Revised" License
222 stars 23 forks source link

Use utilities to deduce enumeration underlying type #218

Closed GabrielDosReis closed 2 years ago

GabrielDosReis commented 2 years ago

The primary purpose of this patch is to remove a couple of places where static_cast is being used to beat a value into int representation. That battle was lost a decade ago, and again with std::span. Adjust to new reality.

As a secondary purpose, this patch introduces a utility to retrieve the underlying value representation of an enumeration value without using static_cast.

Fixes #216 Fixes #217