From: Christopher Dykes Date: Fri, 7 Jul 2017 09:59:14 +0000 (-0700) Subject: Determine noexcept'ness of folly::Optional with std::is_nothrow_constructible X-Git-Tag: v2017.07.10.00~4 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f0dfe0f699c68867eccde9dda9fe1617ef31303e;p=folly.git Determine noexcept'ness of folly::Optional with std::is_nothrow_constructible Summary: Because MSVC is not happy about how it's written now. Reviewed By: yfeldblum Differential Revision: D5378740 fbshipit-source-id: 8b77d1a05da75b331e0cb72bd0ad859b89e54b36 --- diff --git a/folly/Optional.h b/folly/Optional.h index c6980c18..ce8bcf1a 100644 --- a/folly/Optional.h +++ b/folly/Optional.h @@ -128,8 +128,8 @@ class Optional { } template - explicit Optional(in_place_t, Args&&... args) - noexcept(noexcept(::new (nullptr) Value(std::declval()...))) { + explicit Optional(in_place_t, Args&&... args) noexcept( + std::is_nothrow_constructible::value) { construct(std::forward(args)...); }