(wangle) s/continuation_/callback/ (missed some)
[folly.git] / folly / Optional.h
index f0d21c982b3c7dbad2244062d302b05c1048c45c..701d744e9ad4ff16928afc2aea6c8962e71ef60d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 Facebook, Inc.
+ * Copyright 2014 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -61,6 +61,7 @@
 
 #include <boost/operators.hpp>
 
+#include <folly/Portability.h>
 
 namespace folly {
 
@@ -112,15 +113,17 @@ class Optional {
     }
   }
 
-  /* implicit */ Optional(const None&)
+  /* implicit */ Optional(const None&) noexcept
     : hasValue_(false) {
   }
 
-  /* implicit */ Optional(Value&& newValue) {
+  /* implicit */ Optional(Value&& newValue)
+    noexcept(std::is_nothrow_move_constructible<Value>::value) {
     construct(std::move(newValue));
   }
 
-  /* implicit */ Optional(const Value& newValue) {
+  /* implicit */ Optional(const Value& newValue)
+    noexcept(std::is_nothrow_copy_constructible<Value>::value) {
     construct(newValue);
   }