std::moneypunct<CharT,International>::curr_symbol, do_curr_symbol

Header: <locale>

  1. Public member function, calls the member function do_curr_symbol of the most derived class.

# Declarations

public:
string_type curr_symbol() const;
protected:
virtual string_type do_curr_symbol() const;

# Return value

The object of type string_type holding the currency symbol or code.

# Example

#include <iostream>
#include <locale>
 
void show_ccy(const char* locname)
{
    std::locale loc(locname);
    std::cout << locname << " currency symbol is "
              << std::use_facet<std::moneypunct<char, true>>(loc).curr_symbol()
              << "or " << std::use_facet<std::moneypunct<char>>(loc).curr_symbol()
              << " for short\n";
}
 
int main()
{
    show_ccy("en_US.utf8");
    show_ccy("ja_JP.utf8");
    show_ccy("sv_SE.utf8");
    show_ccy("ru_RU.utf8");
    show_ccy("vi_VN.utf8");
}

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
LWG 666C++98the length of the identifier string was required to be 4 if International is truenot required

# See also