静态成员函数返回表示经典C区域设置的区域设置对象。
static const locale& classic( );
返回值
引用到C区域设置。
备注
经典C区域设置是美国.. 英语ASCII区域设置在隐式程序中使用不国际化的标准C库中。
示例
// locale_classic.cpp
// compile with: /EHsc
#include <iostream>
#include <string>
#include <locale>
using namespace std;
int main( )
{
locale loc1( "german" );
locale loc2 = locale::global( loc1 );
cout << "The name of the previous locale is: " << loc2.name( )
<< "." << endl;
cout << "The name of the current locale is: " << loc1.name( )
<< "." << endl;
if (loc2 == locale::classic( ) )
cout << "The previous locale was classic." << endl;
else
cout << "The previous locale was not classic." << endl;
if (loc1 == locale::classic( ) )
cout << "The current locale is classic." << endl;
else
cout << "The current locale is not classic." << endl;
}
要求
标头: <locale>
命名空间: std