|
-
August 6th, 2010, 02:19 AM
#1
Standard Macros
I'm wondering if there are any "standard", and what they are ("or a link to good resources")
For example, I've seen a ton of files that start with "#ifndef __cpluplus". I take it it implies that all c++ compilers MUST activate the __cplusplus macro.
I'm particularly interested in knowing:
-Debug: AFAIK, in debug build, either _DEBUG or DEBUG or always set
-Compiler vendor/version: What are the main macros each of these compilers activate?
-c++ version: Is there a standard macro to know if we are using C++ 98/03/0x? To know if I can/can't include r-value references, for example
-Already included standard headers: For example, add stream functionality only if <iostream> is already included.
Is your question related to IO?
Read this C++ FAQ article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|