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

`emplace` should return the value emplaced #34

Closed improbable-nickkrempel closed 6 years ago

improbable-nickkrempel commented 6 years ago

Currently it returns void instead of a reference to the emplaced value.

See https://en.cppreference.com/w/cpp/utility/optional/emplace.

martinmoene commented 6 years ago

Thanks. This appears to be a fault in the Readme.

improbable-nickkrempel commented 6 years ago

Ah yes, the code was already fixed in https://github.com/martinmoene/optional-lite/commit/465a8bd38bfd61692948be95b2f317fd0d11d57e. Thanks!