|
It amused me that in the age of C++ 11, the best the folk over at Visual C++ Dev Center could come up with for their title graphic was...
#define VISUAL_STUDIO
I thought macro's were generally regarded as bad style in modern C++.
I suspect their graphic artists just opened a C++ sample and looked at the first few lines.
<Edit>
Actually, it seems that the Visual Studio dev center, however I did get there by following a link to "Visual C++ Dev Center" on their sidebar.
</Edit>
modified 11-Jan-13 10:12am.
|
|
|
|
|
A link or it does not exist.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
Sorry, I kind of assumed folk here may know how to get to MSDN Dev Centers...
Obligatory Link[^]
|
|
|
|
|
My apologies, I went there and it did not show that page back then ... It definitely cannot be missed
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
1. Go to MSDN
2. Follow Link to "Visual C++ Developer Center"
|
|
|
|
|
Rob Grainger wrote: I thought macro's were generally regarded as bad style in modern C++.
Well macros like max and min are considered bad. But macros such as VISUAL_STUDIO (to indicate the environment) , DEBUG and RELEASE for which there is no alternative (inline function or const) are not really bad.
|
|
|
|
|
Yes, but hardly a good example of cutting edge C++.
Further, VISUAL_STUDIO is not in the list of Predefined Macros[^], so this is not really in that category
DEBUG and RELEASE are OK though, I'll give you that.
|
|
|
|
|
Rob Grainger wrote: I thought macro's were generally regarded as bad style in modern C++.
Just out of curiosity, can you rewrite a macro like ASSERT as an inline and still have DebugBreak() take you to the offending line of code instead of the call to DebugBreak() in the inline function/method?
Every time I try to embrace the idea of discarding the idea of MACROS, I find too many gems in MFC that I struggle to find an equivalent for in a macro free zone.
|
|
|
|
|
bob16972 wrote: I find too many gems in MFC
I don't think MFC is regarded as a particularly good illustration of modern code either.
ATL is much closer, as was WTL (which has since been dropped by MS, don't know what its current status is).
I think assert() is probably one of the few cases where macros are really unavoidable, similarly code that intends to use the predefined __LINE__ and __FILE__ macros.
|
|
|
|