A proposal for named constants in C

Pascal Cuoq - 30th Sep 2012

If you liked my earlier proposal for a finer-grained restrict (1 2 3 4) you might like this slightly more serious proposal for named constants in C on Jens Gustedt's blog.

Or not. Here is a simple test to tell if you are likely to be interested: if you can readily discuss the relative advantages of const int C=1; #define C 1 and enum { C = 1 }; you will probably find Jens' proposal for arbitrary types fascinating.

Pascal Cuoq
30th Sep 2012