#pragma once
+#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5
+#error Folly.Poly requires gcc-5 or greater
+#endif
+
#include <cassert>
#include <new>
#include <type_traits>
#include <typeinfo>
#include <utility>
-#include <folly/Assume.h>
+#include <folly/CPortability.h>
#include <folly/CppAttributes.h>
#include <folly/Traits.h>
#include <folly/detail/TypeList.h>
+#include <folly/lang/Assume.h>
#if !defined(__cpp_inline_variables)
#define FOLLY_INLINE_CONSTEXPR constexpr
/**
* Exception type that is thrown on invalid access of an empty `Poly` object.
*/
-struct BadPolyAccess : std::exception {
+struct FOLLY_EXPORT BadPolyAccess : std::exception {
BadPolyAccess() = default;
char const* what() const noexcept override {
return "BadPolyAccess";
* Exception type that is thrown when attempting to extract from a `Poly` a
* value of the wrong type.
*/
-struct BadPolyCast : std::bad_cast {
+struct FOLLY_EXPORT BadPolyCast : std::bad_cast {
BadPolyCast() = default;
char const* what() const noexcept override {
return "BadPolyCast";