Boost logo

Boost Users :

Subject: Re: [Boost-users] Question about boost::locale translations
From: Dominique Devienne (ddevienne_at_[hidden])
Date: 2012-11-06 05:46:27


On Tue, Nov 6, 2012 at 11:11 AM, Artyom Beilis <artyomtnk_at_[hidden]> wrote:
> You can use message_format facet directly [...]
> char const *gettext(char const *input) {
> try {
> std::locale l;
> boost::locale::message_facet<char> const &facet =
> std::use_facet<boost::locale::message_facet<char> >(l);
> char const *r = facet.get(my_domain_id,0,input);
> if(r) return r;
> return input;
> } [...]
> }

Much better. But who exactly is in charge of the lifetime of the
returned r pointer? And when does the memory get released exactly (if
ever)? Just curious. The API doc you linked to doesn't say. Is there a
higher-level doc that discussed memory management of those translated
C strings? TIA, --DD


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net