I try to create a locale with following line of code:
std::locale loc(std::locale::classic(), new comma);
The definition of comma
is:
struct comma : std::numpunct<char> {
char do_decimal_point() const { return ','; }
};
I thought it should work as I saw a similar constructor call in the MSDN documentation to facet. Unfortunatelly I get the error:
error C2664: '__thiscall std::locale::std::locale(const char *,int)' : cannot convert parameter number 1 from 'const class std::locale' in 'const char *'
Do you know, how I can get it right?
There are a some answers on Stackoverflow, which do it right this way (this, or this one). But it seems, that the old VC6 compiler doesn't support this constructor (although the example in the VC6 documentation uses it). But there must be a way to use facets with VC6, otherwise it wouldn't be part of the documentation.