Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/locale/locale/global"

From cppreference.com
< cpp‎ | locale‎ | locale
(Created page with "{{cpp/locale/title | global}} {{cpp/locale/locale/sidebar}} {{ddcl | header=locale | static locale global( const locale& loc ); }} Replaces the global C++ locale with {{tt|loc}...")
 
(title)
Line 1: Line 1:
{{cpp/locale/title | global}}
+
{{cpp/locale/locale/title | global}}
 
{{cpp/locale/locale/sidebar}}
 
{{cpp/locale/locale/sidebar}}
  

Revision as of 06:59, 20 January 2012

Template:cpp/locale/locale/sidebar

Defined in header <locale>
static locale global( const locale& loc );

Replaces the global C++ locale with loc, which means all future calls to the Template:cpp default constructor will now return a copy of loc. If loc has a name, also replaces the C locale as if by Template:cpp. This function is the only way to modify the global C++ locale, which is otherwise equivalent to Template:cpp at program startup.

Contents

Parameters

loc - the new global C++ locale

Return value

The previous value of the global C++ locale.

Example

Template:example cpp

See also

Template:cpp/locale/locale/dcl list localeTemplate:cpp/locale/locale/dcl list classicTemplate:cpp/locale/dcl list setlocale