2008 May 5th Monday (五月 五日 月曜日)

来源:互联网 发布:福禄克网络测试表 编辑:程序博客网 时间:2024/04/30 04:44
My house is selling.  I don't know when can be sold.  By the way, if I go back to Wuhan, I will have to finda new job.  Suddenly, I am aware to go back home is not easy.  I must be waiting, waiting a chance.  Unnamed NamespacesYou can create an unnamed namespace by omitting the namespace name:namespace        // unnamed namespace{    int ice;    int bandycoot;}  This behaves as if it were followed by a using-directive;  that is, the names declared in this namespace are inpotential scope until the end of the declarative region containing the unnamed namespace.  In this respect, theyare like global variables.  However, because the namespace has no name, you can't explicitly use a using-directiveor using-declaration to make the names available elsewhere. In particular, you can't use names from an unnamednamespace in a file other than the one containing the namespace declaration.  This provides an alternative to usingstatic variables with internal linkage.  Indeed, the C++ standard deprecates the use of the keyword static in namespacesand global scope.  ("Deprecate" is a term the standard uses to indicate practices that currently are valid but mostlikely will be rendered invalid by future revisions of the standard.)
原创粉丝点击