Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
std::basic_ios::imbue(3)      C++ Standard Libary     std::basic_ios::imbue(3)

NAME
       std::basic_ios::imbue - std::basic_ios::imbue

Synopsis
	  std::locale imbue( const std::locale&	loc );

	  Replaces  the	current	locale.	Effectively calls ios_base::imbue(loc)
       and if there is
	  an associated	stream buffer (rdbuf() != 0), then calls  rdbuf()->pu-
       bimbue(loc).

Parameters
	  loc -	the new	locale

Return value
	  The previous locale, as returned by ios_base::imbue(loc).

Exceptions
	  May throw implementation-defined exceptions.

Example
       // Run this code

	#include <iostream>
	#include <sstream>
	#include <locale>

	int main()
	{
	    std::istringstream iss;
	    iss.imbue(std::locale("en_US.UTF8"));

	    std::cout << "Current locale: " << iss.getloc().name() << '\n';

	    iss.imbue(std::locale());
	    std::cout << "Global locale	: " << iss.getloc().name() << '\n';
	}

Output:
	Current	locale:	en_US.UTF8
	Global locale :	C

http://cppreference.com		  2022.07.31	      std::basic_ios::imbue(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=std::wios::imbue&sektion=3&manpath=FreeBSD+Ports+15.0>

home | help