Boost logo

Boost :

Subject: Re: [boost] [review] string convert
From: Scott McMurray ([hidden])
Date: 2011-05-04 15:03:09

On Wed, May 4, 2011 at 11:37, Matthew Chambers
<matt.chambers42_at_[hidden]> wrote:
> Did we just rediscover Vladimir's reasoning for the ::from interface?

Sounds like :)

> If so, I think the cure is worse than the disease.

I really like the split into two parts, to allow a direction word.

If you don't like the ::from, what about something like this?
    optional<int> i = convert(x).to<int>(std::nothrow); // or maybe

It's arguably the same as the .value() in Vladimir's lib, except that
by delaying providing the type, it makes sense that it's needed.

The scary implicit conversions might even make some sense when there's
no destination type:
    int i = convert(x);

~ Scott

Boost list run by bdawes at, gregod at, cpdaniel at, john at