I think it's very dangerous and would rather use explicit code :-) Less appealing aesthetically maybe but much better in the grand scheme of things :-)
Poor man's RAII. I'd prefer EMB to implement record destructors and friends so we can do it properly. Tho without scoped variables it may not be that useful...
This is an often used feature. Have used it to auto destroy locally created objects, for measuring times, logging etc.
ReplyDeleteYup, I've got similar code in my toolbox.
ReplyDeleteI think it's very dangerous and would rather use explicit code :-)
ReplyDeleteLess appealing aesthetically maybe but much better in the grand scheme of things :-)
It's only dangerous if you don't know how interfaces work. :-)
ReplyDeleteI disagree, I am against the whole concept of Any code just because, well, of any possible code ;-)
ReplyDeleteSee what I mean?
Doh! :facepalm: The only thing I can offer is that I hadn't yet had my coffee.
ReplyDeletePoor man's RAII. I'd prefer EMB to implement record destructors and friends so we can do it properly. Tho without scoped variables it may not be that useful...
ReplyDelete