GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::use_facet(3) C++ Standard Libary std::use_facet(3)

std::use_facet - std::use_facet


Defined in header <locale>
template< class Facet >
const Facet& use_facet( const std::locale& loc );


Obtains a reference to a facet implemented by loc.


loc - the locale object to query


Returns a reference to the facet. The reference returned by this function is valid
as long as any std::locale object exists that implements Facet.


std::bad_cast if std::has_facet<Facet>(loc) == false.


Display the 3-letter currency name used by the user's preferred locale

// Run this code


#include <iostream>
#include <locale>


int main()
{
std::locale loc = std::locale(""); // user's preferred locale
std::cout << "Your currency string is "
<< std::use_facet<std::moneypunct<char, true>>(loc).curr_symbol() << '\n';
}


Your currency string is USD


locale set of polymorphic facets that encapsulate cultural differences
(class)
has_facet checks if a locale implements a specific facet
(function template)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.