martinmoene / optional-lite

optional lite - A C++17-like optional, a nullable object for C++98, C++11 and later in a single-file header-only library
Boost Software License 1.0
403 stars 45 forks source link

Enhance in_place construction #66

Closed fekir closed 3 years ago

fekir commented 3 years ago

The current implementation required ad least a move-constructor for in-place construction. This made it impossible to directly, create an optional of a type without copy and move operators.

A workaround is using the variadic emplace function, but it requires to construct the object in two steps.

std::optional does not require any copy or move operation for in-place construction

martinmoene commented 3 years ago

Thanks for your contribution.

I'll tend to CASE( "make_optional: Allows to in-place copy-construct optional from arguments (C++11)" ) that appears similar to the test you did update.

martinmoene commented 3 years ago

Think all is taken care of now and the PR can be closed now.

fekir commented 3 years ago

thank you @martinmoene

can I ask if there are any plans for a new release?

martinmoene commented 3 years ago

@fekir A new release seems in order. Will address that in the coming days.

martinmoene commented 3 years ago

Released optional lite version 3.5.0.