gcc-4.8 is not decaying types correctly in lambda init captures. Help it out. Fixes...
[folly.git] / folly / detail / FunctionalExcept.cpp
index f569f94508ea4773e942aa477a6ed7ff165229a7..13a7b7d7d01733be4143d8802a1a7483c33c5371 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  */
 
-#include "folly/detail/FunctionalExcept.h"
+#include <folly/Portability.h>
+
+// If FOLLY_HAVE_BITS_FUNCTEXCEPT_H is set, this file compiles to
+// nothing.
+
+#if !FOLLY_HAVE_BITS_FUNCTEXCEPT_H
+
+#include <folly/detail/FunctionalExcept.h>
 
 #include <stdexcept>
 
@@ -32,4 +39,12 @@ void __throw_out_of_range(const char* msg) {
   throw std::out_of_range(msg);
 }
 
+#if defined(_MSC_VER)
+void __throw_bad_alloc() {
+  throw std::bad_alloc();
+}
+#endif
+
 FOLLY_NAMESPACE_STD_END
+
+#endif