Boost logo

Boost :

Subject: Re: [boost] request for comments in a new format library
From: Frédéric (ufospoke_at_[hidden])
Date: 2018-02-25 07:21:04


> - In oder to customize numeric punctuation, fmt forces you to change the
> current locate. I find this bad because It means modifying a global state.
> Also, I presume that fmt delegate the job to std::ostream in this case,
> which I suspect must reduce the performance considerably.

Yes this is an issue I have. They use vsnprintf if I remember
correctly and there is no way to pass the locale as argument which is
a big issue in multithread programs.

> - stringify decouples formatting from translation, for instance:
>
> namespace strf = boost::stringify::v0;
>
> auto str = strf::make_string
> [ gettext("your login is: {0}\n your access code is: {1}") ]
> &= { strf::right(login, 40) , strf::hex(code) > 40 };

I like this idea. This keeps the possibility to have easy translations
and allows for compile time checks.

> The message to be translated does not contain formatting. Hence:
> - There is less chances that the translator team ( which is usually not
> composed by programmers ) make some mistake.
> - Enables you to change the formatting without requesting the
> translators to update the translated strings.

good point.

Thanks,

F


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