Fix copyright lines
[folly.git] / folly / futures / detail / Core.h
index f88da8e5a245a383d4b4e69a52f5a0747b27779e..6adc841b3737fe5483fdccc2daf0c5383ce36315 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2014-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,6 +31,7 @@
 #include <folly/Utility.h>
 #include <folly/futures/FutureException.h>
 #include <folly/futures/detail/FSM.h>
+#include <folly/portability/BitsFunctexcept.h>
 
 #include <folly/io/async/Request.h>
 
@@ -76,7 +77,7 @@ enum class State : uint8_t {
 /// first blush, but it's the same principle. In general, as long as the user
 /// doesn't access a Future or Promise object from more than one thread at a
 /// time there won't be any problems.
-template<typename T>
+template <typename T>
 class Core final {
   static_assert(!std::is_void<T>::value,
                 "void futures are not supported. Use Unit instead.");
@@ -134,7 +135,7 @@ class Core final {
     if (ready()) {
       return *result_;
     } else {
-      throw FutureNotReady();
+      throwFutureNotReady();
     }
   }
 
@@ -160,7 +161,7 @@ class Core final {
       case State::OnlyCallback:
       case State::Armed:
       case State::Done:
-        throw std::logic_error("setCallback called twice");
+        std::__throw_logic_error("setCallback called twice");
     FSM_END
 
     // we could always call this, it is an optimization to only call it when
@@ -187,7 +188,7 @@ class Core final {
       case State::OnlyResult:
       case State::Armed:
       case State::Done:
-        throw std::logic_error("setResult called twice");
+        std::__throw_logic_error("setResult called twice");
     FSM_END
 
     if (transitionToArmed) {
@@ -438,8 +439,11 @@ void collectVariadicHelper(const std::shared_ptr<T<Ts...>>& /* ctx */) {
   // base case
 }
 
-template <template <typename ...> class T, typename... Ts,
-          typename THead, typename... TTail>
+template <
+    template <typename...> class T,
+    typename... Ts,
+    typename THead,
+    typename... TTail>
 void collectVariadicHelper(const std::shared_ptr<T<Ts...>>& ctx,
                            THead&& head, TTail&&... tail) {
   using ValueType = typename std::decay<THead>::type::value_type;