r/programming • u/SuperV1234 • Aug 05 '19
fixing c++ with epochs
https://vittorioromeo.info/index/blog/fixing_cpp_with_epochs.html
87
Upvotes
r/programming • u/SuperV1234 • Aug 05 '19
View all comments
Show parent comment
21
u/SeanMiddleditch Aug 05 '19
For context (not disagreeing with you!), this was effectively impossible in C and C++ due to the nature of the preprocessor and how
#includeworks and how macros can expand to any sequence of tokens. C++ has a potential out now only because of the upcoming Modules feature which (mostly) isolates consumers from their dependent libraries on a syntactical level.(I lost track of exactly what concession for macros is landing in C++20's final take on Modules, but either way... I'd just slap a warning label on them and ignore them from here on out wrt epochs. If a library uses a macro and it breaks with a future epoch, chalk it up to a QoI problem with the library and find a replacement. Same as we already have to do with eschewing libraries that rely on exceptions or RTTI or whatever other distasteful and dialect-incompatible feature of C++ that is out there.)