Re:How to design a replacement for C++
by ToastOpt on Thursday July 22, 2010 @12:39AM
(#1537373)
Yes. Many a time I have wished to import a library's symbols without importing its macros. Or better yet, import its symbols under alternate names. "namespace x = import<y.h>" anyone?
[ Parent
| on HN ]
Yes, the biggest problem with #includes is the namespace cross contamination they can cause. I once tracked a build problem down to someone #defining usleep(time) to 'sleep(time/1000)' (or something similar). Problem was, usleep was included later, so the definition of the real usleep got replaced with gibberish that did math inside a function declaration.