money_put::put
Konwertuje liczba lub ciąg sekwencję znaków, który reprezentuje wartość pieniężną.
iter_type put(
iter_type _Next,
bool _Intl,
ios_base& _Iosbase,
CharType _Fill,
const string_type& _Val
) const;
iter_type put(
iter_type _Next,
bool _Intl,
ios_base& _Iosbase,
CharType _Fill,
long double _Val
) const;
Parametry
_Next
Iterację adresowania pierwszy element wstawiony ciąg._Intl
Wartość logiczna, wskazująca typ oczekiwany w sekwencji symbol waluty: true Jeśli międzynarodowych, false Jeśli krajowych._Iosbase
Format bandery która, gdy zestaw wskazuje, że symbol waluty jest opcjonalny; w przeciwnym razie jest to wymagane_Fill
Znak, który jest używany dla odstępów._Val
Obiekt string do konwersji.
Wartość zwracana
Dane wyjściowe iterację produkowane jedną pozycję za ostatni element adresy.
Uwagi
Both member functions return do_put(_Next, _Intl, _Iosbase, _Fill, _Val).
Przykład
// money_put_put.cpp
// compile with: /EHsc
#include <locale>
#include <iostream>
#include <sstream>
using namespace std;
int main( )
{
// locale loc( "german_germany" );
locale loc( "english_canada" );
basic_stringstream<char> psz, psz2;
ios_base::iostate st = 0;
psz2.imbue( loc );
psz2.flags( psz2.flags( )|ios_base::showbase ); // force the printing of the currency symbol
use_facet < money_put < char > >(loc).put(basic_ostream<char>::_Iter( psz2.rdbuf( ) ), true, psz2, st, 100012);
if (st & ios_base::failbit)
cout << "money_put( ) FAILED" << endl;
else
cout << "money_put( ) = \"" << psz2.rdbuf( )->str( ) <<"\""<< endl;
st = 0;
};
Wymagania
Nagłówek:<ustawień regionalnych>
Przestrzeń nazw: std