Boost logo

Boost Users :

Subject: Re: [Boost-users] Bug when using boost::optional with boost::program_options?
From: Jim Porter (jvp4846_at_[hidden])
Date: 2018-06-06 03:58:05


On 6/5/2018 8:50 PM, degski via Boost-users wrote:
> On 5 June 2018 at 18:51, Xavier Besseron via Boost-users
> <boost-users_at_[hidden] <mailto:boost-users_at_[hidden]>> wrote:
>
> I hope this will help.
>
> Maybe you should/could create a PR, then in the future (if and when it
> get's merged, you don't have to fiddle with the boost code either).

Code similar to what Xavier posted is in Boost 1.65+, but if you want to
support earlier versions of Boost (or use std::optional instead of
boost::optional), you have to do something like that. It would probably
be worth adding an overload that works with std::optional, but I don't
know if I'll have time in the near future to shepherd a patch into Boost.

- Jim


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