Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the boost equivalent to std::optional nullopt?

Tags:

c++

boost

I've imported some code pieces from a third party project into my C++11 project. The third party project uses optional-lite [1], though I'm using Boost heavily in the project and want to keep dependency on other libraries low.

There is boost::optional, but unlike the c++17 counterpart it does not have nullopt.

What's the Boost equivalent to nullopt?

(Note: Boost version is 1.69)

[1] https://github.com/martinmoene/optional-lite

like image 691
benjist Avatar asked Mar 31 '19 15:03

benjist


1 Answers

The equivalent is boost::none. See optional(none_t).

like image 98
Jarod42 Avatar answered Sep 22 '22 21:09

Jarod42