iamantony / CppNotes

My notes about C++
MIT License
1 stars 3 forks source link

Enum #1

Closed iamantony closed 8 years ago

iamantony commented 9 years ago

https://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++

"

append new enumerators to an existing enum. Exeption: if that leads to the compiler choosing a larger underlying type for the enum, that makes the change binary-incompatible. Unfortunately, compilers have some leeway to choose the underlying type, so from an API-design perspective it's recommended to add a Max.... enumerator with an explicit large value (=255, =1<<15, etc) to create an interval of numeric enumerator values that is guaranteed to fit into the chosen underlying type, whatever that may be. "