3 ms·
In the code listing on the 4th page [0], why is MaxGThreads and StackSize wrapped in an enum? I would use an enum when I might want some values to be mutually
by ndesaulniers 9y ago
In the code listing on the 4th page [0], why is MaxGThreads and StackSize wrapped in an enum? I would use an enum when I might want some values to be mutually exclusive. Seems like these values aren't even used in the same context? I would use static const ints.
[0] https://c9x.me/articles/gthreads/code0.html https://c9x.me/articles/gthreads/code0.html
- caf 9y agoBecause in C (as opposed to C++), a static const int is not a compile-time constant (so you can't use it in places like switch case labels).