Boost logo

Boost Users :

Subject: Re: [Boost-users] [optional]
From: Dominique Devienne (ddevienne_at_[hidden])
Date: 2009-05-06 09:59:36


On Wed, May 6, 2009 at 4:44 AM, Gevorg Voskanyan <v_gevorg_at_[hidden]> wrote:
> Igor R wrote:
>> > f(p1, boost::optional<Param2>(p2), boost::optional<Param3>(),
>> > boost::optional<Param4>(p4) );
>>
>> The params would be implicitly converted, so you can call like this:
>> f(p1, p2, boost::optional<Param3>(), p4);
>
> boost::none will be helpful as well:
> f(p1, p2, boost::none, p4);

Beside the headers, Google doesn't yield documentation on boost::none.

Could someone please explain it's intended use? I see none_t is a
typedef to a member of none_helper, a struct with no members, and none
is a const none_t, but I'd expect such a pointer to not be convertible
to anything, so I'm not following on passing boost::none to a
boost::optional as above, nor can't figure out the use for none. Can
someone please provide some details / background info on none? Thanks,
--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