Commit c39c808c authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot

Silence a couple of warnings for MSVC in Optional.h

Summary: Silence a couple of warnings that get very spammy for MSVC.

Reviewed By: yfeldblum

Differential Revision: D4098682

fbshipit-source-id: b410b56062cdf82367675ea9c3dd22975e7b91bd
parent 823ecf89
......@@ -59,6 +59,8 @@
#include <type_traits>
#include <utility>
#include <folly/Portability.h>
namespace folly {
namespace detail { struct NoneHelper {}; }
......@@ -292,10 +294,16 @@ class Optional {
};
};
FOLLY_PUSH_WARNING
// These are both informational warnings, but they trigger rare enough
// that we've left them enabled.
FOLLY_MSVC_DISABLE_WARNING(4587) // constructor of .value is not called
FOLLY_MSVC_DISABLE_WARNING(4588) // destructor of .value is not called
StorageNonTriviallyDestructible() : hasValue{false} {}
~StorageNonTriviallyDestructible() {
clear();
}
FOLLY_POP_WARNING
void clear() {
if (hasValue) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment