« Return to Thread: [convert] Now with Boost.Parameter interface.

Re: [convert] Now with Boost.Parameter interface.

by Scott McMurray-2 :: Rate this Message:

Reply to Author | View in Thread

On 2009-05-06, Emre Turkay <emreturkay2@...> wrote:

>
> I think ability to set persistent behavior would be nice. Something like
> this;
>
> 1. convert::set(locale_ = new_locale)(throw_ = true);
> 2. int i = convert<int>::from(str1, 0);
> 3. int j = convert<int>::from(str2, 0);
>
> The line #1 effect lines following it (#2 & #3).
>

I really don't like the idea of global state for this.

Making reusable "format packs" would be nice, though.  Perhaps
instances of the convert class should be allowed, so you could do
something like this?

    convert<int> myconvert((locale_ = new_locale, throw_ = true));
    int i = myconvert.from(str1, 0);
    int j = myconvert.from(str1, 0);

Just musing,
~ Scott
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

 « Return to Thread: [convert] Now with Boost.Parameter interface.