format icon indicating copy to clipboard operation
format copied to clipboard

Allow the use of std::optional in C++2017

Open SeanFarrow opened this issue 6 years ago • 3 comments

It would be good if std::optional<T> were used in projects that use C++2017.

A define like that which is available in boost.dll 1.70 would suffice in my opinion.

SeanFarrow avatar Mar 29 '19 13:03 SeanFarrow

Could you be more specific, perhaps provide an example use?

jeking3 avatar Apr 19 '19 10:04 jeking3

This isn’t something that is user facing.

Within the boost format library boost::optional is used, what I’m asking for is a define to use std::optional instead, like boost.dll does with boost/std::filesystem. If I get a chance next week, I’ll create a PR.

From: James E. King III [email protected] Sent: 19 April 2019 11:56 To: boostorg/format [email protected] Cc: Sean Farrow [email protected]; Author [email protected] Subject: Re: [boostorg/format] Allow the use of std::optional in C++2017 (#63)

Could you be more specific, perhaps provide an example use?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/boostorg/format/issues/63#issuecomment-484851233, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AALDK7XI7HTCAB3JGGRASRLPRGQLNANCNFSM4HCJOEGQ.

SeanFarrow avatar Apr 19 '19 15:04 SeanFarrow

Isn't there an language macro that is defined the the compiler supports the standard optional instead of the boost one that can be checked against like there is with CXX_LIB_FILESYSTEM/CXX_LIB_EXPERIMENTAL_FILESYSTEM or something along those lines that can be used with boost?

(unrelated but I want to also figure out things I can use in place of format and wformat used in this lib so that way a program of mine could be made a bit more optimized.)

(hmm so is

typedef lagged_fibonacci_01_engine<double, 48, 607, 273> lagged_fibonacci607;

the same as this?

std::subtract_with_carry_engine<double, 48, 607, 273>

)

AraHaan avatar Sep 08 '20 06:09 AraHaan