Boost logo

Boost :

Subject: Re: [boost] [locale] Review
From: Gevorg Voskanyan (v_gevorg_at_[hidden])
Date: 2011-04-18 09:06:59


Artyom wrote:
> If so please implement following in C correctly:
>
>
> void delete_values_above_x(double x)
> {
> char statement[256];
> snprintf(statement,sizeof(statement),"DELETE FROM sometable WHERE x >
>%f",x);
> mysql_query(connection,statement)
> }
>
> When in current locale the decimal point is "," and x=3.14...
>
> You can't do it in reasonable simple way in C.
> It is design issue of standard C and C++ library.
>
> Artyom

While I agree about the standard C library, what issue does C++ standard library
have here?
You can just imbue std::locale::classic() and you are good to go. Am I missing
something?

Gevorg


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk