Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::locale::global

      From cppreference.com
      <cpp‎ |locale‎ |locale
       
       
       
      Localization library
       
       
      static locale global(const locale& loc);

      Replaces the global C++ locale withloc, which means all future calls to thestd::locale default constructor will now return a copy ofloc. Ifloc has a name, also replaces the C locale as if bystd::setlocale(LC_ALL, loc.name().c_str());. This function is the only way to modify the global C++ locale, which is otherwise equivalent tostd::locale::classic() at program startup.

      Contents

      [edit]Parameters

      loc - the new global C++ locale

      [edit]Return value

      The previous value of the global C++ locale.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]Defect reports

      The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

      DRApplied toBehavior as publishedCorrect behavior
      LWG 8C++98it was unspecified whether other library functions (such
      asstd::setlocale) can modify the global C++ locale
      specified (no other
      library functions allowed)

      [edit]See also

      constructs a new locale
      (public member function)[edit]
      [static]
      obtains a reference to the "C" locale
      (public static member function)[edit]
      gets and sets the current C locale
      (function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/locale/locale/global&oldid=177156"

      [8]ページ先頭

      ©2009-2025 Movatter.jp