
10 Dec
2008
10 Dec
'08
5:26 p.m.
AMDG Agustín K-ballo Bergé wrote:
I'm working on a small library to safely work with options made of flags combinations. I'm currently looking for a way to automatically generate contiguous indices, pretty much as an enum does.
I was able to achieve this in a very impractical way, which I fear may be based on a compiler bug or an implementation-defined issue. I do not have access to the standard, and I will appreciate if someone with more experience than I could look at the code to confirm my fears. My doubts on standard conformance are mainly
- compile time flags: the sizeof a function call expression changes as new overloads (better matches) are added.
Undefined behavior. (14.6.4.2) In Christ, Steven Watanabe