We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I want to use the #error directive to limit the size of a statically allocated array during compilation (it must not exceed a certain limit, and I want to fail compilation, not startup, if it is too large), but I can only work with constant expressions, of course. Is there a way to do this...?
Thanks.
I forgot to mention that the array can contain various types and I don't know in advance how many elements are in it.
OK, I can add marker at the beginning and end of the array. Something else...?
Maybe Tamir knows the answer ;)
I have nothing to add at this time. Thanks for inviting me to speak (???).
"I forgot to mention that the array can contain various types and I don't know in advance how many elements are in it."
Arrays hold elements of a single type. What do you mean by "the array can contain various types"? How are you implementing an array containing various types?