In the standard library, I found that the namespace is stddeclared as a macro.
std
#define _STD_BEGIN namespace std { #define _STD_END }
Microsoft Visual Studio 9.0\VC\include\yvals.h
Any thoughts ..?
This is probably not the best practice as it is difficult to read compared to the vanilla declaration namespace. However, remember that the rules are not always applied everywhere, and I am sure that there is some kind of scenario in which a macro can significantly improve the situation.
namespace
" STL, . , ?".
, , yvals.h -. , <vector> <memory>, <iterator>, <xutility>, <climits>, <yvals.h>. , - .
yvals.h
<vector>
<memory>
<iterator>
<xutility>
<climits>
<yvals.h>
, ; .
, - , /, .
, , , :
BEGIN_NAMESPACE_XXX()
XXX - , :
BEGIN_NAMESPACE_3(ns1, ns1, ns3)
namespace ns1 { namespace ns2 { namespace ns2 {
END_NAMESPACE_3
} } }
( )
C, ++ (, , C string.h ++ cstring). #ifdef _c_plus_plus.
string.h
cstring
#ifdef _c_plus_plus
. , , , , "" ++ ( , - 90- ). , , , . ; : " X, , , , ". , , , , ANSI C.