Topic: What is the use of the charT parameter in put_money?


Author: "Bo Persson" <bop@gmb.dk>
Date: Mon, 15 Jan 2007 15:06:47 CST
Raw View
Section 27.6.4 of the current draft defines a new function in <iomanip>

template<class charT, class moneyT>
smanip put_money(const moneyT& mon, bool intl = false);


I can't see the use of the charT template parameter, or how it is deduced
from the function parameters.


We are not supposed to write

std::wcout << put_money<wchar_t>(amount);

are we?


Bo Persson


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]





Author: "emreturkay@gmail.com" <emreturkay@gmail.com>
Date: Tue, 16 Jan 2007 08:45:34 CST
Raw View
Hi Bo,

It seems that the moneyT template parameter can be a specialization of
basic_string<charT>.

Emre Turkay

Bo Persson wrote:
> Section 27.6.4 of the current draft defines a new function in <iomanip>
>
> template<class charT, class moneyT>
> smanip put_money(const moneyT& mon, bool intl = false);
>
>
> I can't see the use of the charT template parameter, or how it is deduced
> from the function parameters.
>
>
> We are not supposed to write
>
> std::wcout << put_money<wchar_t>(amount);
>
> are we?
>
>
> Bo Persson
>
>
> ---
> [ comp.std.c++ is moderated.  To submit articles, try just posting with ]
> [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
> [              --- Please see the FAQ before posting. ---               ]
> [ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]





Author: "Bo Persson" <bop@gmb.dk>
Date: Tue, 16 Jan 2007 10:59:00 CST
Raw View
emreturkay@gmail.com wrote:
> Hi Bo,
>
> It seems that the moneyT template parameter can be a specialization
> of basic_string<charT>.

But so can the moneyT of the companion get_money. That function only has a
moneyT template parameter, and no charT. I don't see why there should be a
difference.


Bo Persson


>
> Emre Turkay
>
> Bo Persson wrote:
>> Section 27.6.4 of the current draft defines a new function in
>> <iomanip>
>>
>> template<class charT, class moneyT>
>> smanip put_money(const moneyT& mon, bool intl = false);
>>
>>
>> I can't see the use of the charT template parameter, or how it is
>> deduced from the function parameters.
>>
>>
>> We are not supposed to write
>>
>> std::wcout << put_money<wchar_t>(amount);
>>
>> are we?
>>
>>
>> Bo Persson
>>


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]