▲ | brightprogramer 3 days ago | ||||||||||||||||||||||
Yea the FMT trick uses VA_OPT. I consider myself a noob with C official specification, so you're probably right about that. I do kinda like how foreach is implemented right now. This allows me to perform some strict checking for easy loop iteration based bugs and also it kinda looks cool. This is the first time I came across typeof_unqual. I'll look into it, thanks . I spent a lot of time making this work across all three compilers (especially MSVC). I'm glad MSVC has VA_OPT support. | |||||||||||||||||||||||
▲ | teo_zero 2 days ago | parent [-] | ||||||||||||||||||||||
> I do kinda like how foreach is implemented right now. This allows me to perform some strict checking for easy loop iteration based bugs and also it kinda looks cool. Yes but the body in the parameters really is a show stopper. What if the body has a unprotected comma? Like
Better to expand the macro into one or two "for" and let the body follow. For example:
Please note that I haven't tested it. | |||||||||||||||||||||||
|