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

compile with icc 19 #42

Closed mabraham closed 5 years ago

mabraham commented 5 years ago

https://github.com/martinmoene/optional-lite/blob/ed68dc81d8e4fbe7ece18ed8f1e3111d6258d895/include/nonstd/optional.hpp#L1250 assumes that std17::is_nothrow_swappable::value exists, but for a pre-c++-17 compiler it is not defined in that template class: https://github.com/martinmoene/optional-lite/blob/ed68dc81d8e4fbe7ece18ed8f1e3111d6258d895/include/nonstd/optional.hpp#L459. The latest Intecl compiler (icpc 19) observes this, and refuses to compile the code.

Can we add the appropriate value field?

martinmoene commented 5 years ago

Ah, yes!

On godolt:

martinmoene commented 5 years ago

Solved here : rename function detail::is_nothrow_swappable::test() to satisfies(). Likely test(...) competes with test().

martinmoene commented 5 years ago

@mabraham Can this issue be closed?

mabraham commented 5 years ago

Yes, it fixes the issue

On Tue, 16 Apr 2019 at 22:38, Martin Moene notifications@github.com wrote:

@mabraham https://github.com/mabraham Can this issue be closed?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/martinmoene/optional-lite/issues/42#issuecomment-483833871, or mute the thread https://github.com/notifications/unsubscribe-auth/AAG3Cz6ReEBKRfb5Fa3LdHgF9Y39mkoIks5vhjS3gaJpZM4ckItG .