update stats APIs to use TimePoint vs Duration correctly
[folly.git] / folly / Exception.h
index 28188c639ae8afc972d2a710bed1c809fd292c29..85bbeda47164dba61174a6cecf005b49a99d8bcb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 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.
@@ -14,8 +14,7 @@
  * limitations under the License.
  */
 
-#ifndef FOLLY_EXCEPTION_H_
-#define FOLLY_EXCEPTION_H_
+#pragma once
 
 #include <errno.h>
 
@@ -37,24 +36,19 @@ namespace folly {
 // The *Explicit functions take an explicit value for errno.
 
 // Helper to throw std::system_error
-FOLLY_NORETURN void throwSystemErrorExplicit(int err, const char*);
-inline void throwSystemErrorExplicit(int err, const char* msg) {
+[[noreturn]] inline void throwSystemErrorExplicit(int err, const char* msg) {
   throw std::system_error(err, std::system_category(), msg);
 }
 
 template <class... Args>
-FOLLY_NORETURN void throwSystemErrorExplicit(int, Args&&... args);
-template <class... Args>
-void throwSystemErrorExplicit(int err, Args&&... args) {
+[[noreturn]] void throwSystemErrorExplicit(int err, Args&&... args) {
   throwSystemErrorExplicit(
       err, to<fbstring>(std::forward<Args>(args)...).c_str());
 }
 
 // Helper to throw std::system_error from errno and components of a string
 template <class... Args>
-FOLLY_NORETURN void throwSystemError(Args&&... args);
-template <class... Args>
-void throwSystemError(Args&&... args) {
+[[noreturn]] void throwSystemError(Args&&... args) {
   throwSystemErrorExplicit(errno, std::forward<Args>(args)...);
 }
 
@@ -124,5 +118,3 @@ void throwOnFail(V&& value, Args&&... args) {
   ::folly::throwOnFail<E>((cond), "Check failed: " #cond)
 
 }  // namespace folly
-
-#endif /* FOLLY_EXCEPTION_H_ */