Make FOLLY_HAS_COROUTINES dependent on header
[folly.git] / folly / FormatArg.h
index fec6e811773abe422486cdf2dd11c6f234c462c5..df1054e1bba6b1d043196015f6102b041e947b9a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2012-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.
 namespace folly {
 
 class BadFormatArg : public std::invalid_argument {
- public:
-  explicit BadFormatArg(const std::string& msg)
-    : std::invalid_argument(msg) {}
+  using invalid_argument::invalid_argument;
 };
 
+[[noreturn]] void throwBadFormatArg(char const* msg);
+[[noreturn]] void throwBadFormatArg(std::string const& msg);
+
 /**
  * Parsed format argument.
  */
@@ -213,7 +214,7 @@ inline std::string FormatArg::errorStr(Args&&... args) const {
 
 template <typename... Args>
 [[noreturn]] inline void FormatArg::error(Args&&... args) const {
-  throw BadFormatArg(errorStr(std::forward<Args>(args)...));
+  throwBadFormatArg(errorStr(std::forward<Args>(args)...));
 }
 
 template <bool emptyOk>
@@ -274,4 +275,4 @@ inline int FormatArg::splitIntKey() {
   }
 }
 
-}  // namespace folly
+} // namespace folly