Every so often I encounter, or hear about, a problem with function definitions when the standard header files are included. Most often its mmap, but sometimes it's something else. Every time I think that I should write something up. Well, it's finally happened, a short paper on how to write portable code using the standard headers.
Subscribe to:
Post Comments (Atom)
Thanks for a nice summary, I'll be referring people to it in future as it does a better job than my attempts to explain the feature test macros.
ReplyDeleteListing 9 already includes a using directive, I assume that wasn't meant to be there :)
Also, C++11 removes the rule that headers must not declare names in the global namespace.
Oops, that was supposed to say "that <cxxx> headers must not ..." but it got filtered out as an html tag
ReplyDeleteThanks, no that using namespace std; is not meant to be there.
ReplyDeleteDarryl.