Add counters interface
[folly.git] / folly / Poly.h
index 218fbd8950e9924ce3f6a1e926c43c9cf993f865..f2f4b9008989407c6c0c41cf7086cc234a56a563 100644 (file)
 
 #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
@@ -171,7 +176,7 @@ struct PolyMembers {};
 /**
  * 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";
@@ -182,7 +187,7 @@ struct BadPolyAccess : std::exception {
  * 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";