remove outer Try from whenAll/whenN/whenAny callbacks
[folly.git] / folly / File.h
index 1c6793fa72346dda229e739c40d34de914a5a88d..4a25e1c6938f82ad6dba340450116a4ed8e71550 100644 (file)
@@ -22,6 +22,8 @@
 #include <fcntl.h>
 #include <unistd.h>
 
+#include <folly/Portability.h>
+
 namespace folly {
 
 /**
@@ -38,15 +40,12 @@ class File {
    * Create a File object from an existing file descriptor.
    * Takes ownership of the file descriptor if ownsFd is true.
    */
-  /* implicit */ File(int fd,
-                      bool ownsFd = false);
+  explicit File(int fd, bool ownsFd = false);
 
   /**
    * Open and create a file object.  Throws on error.
    */
-  /* implicit */ File(const char* name,
-                      int flags = O_RDONLY,
-                      mode_t mode = 0644);
+  explicit File(const char* name, int flags = O_RDONLY, mode_t mode = 0666);
 
   ~File();
 
@@ -88,7 +87,7 @@ class File {
    * Returns and releases the file descriptor; no longer owned by this File.
    * Returns -1 if the File object didn't wrap a file.
    */
-  int release();
+  int release() noexcept;
 
   /**
    * Swap this File with another.
@@ -96,7 +95,7 @@ class File {
   void swap(File& other);
 
   // movable
-  File(File&&);
+  File(File&&) noexcept;
   File& operator=(File&&);
 
   // FLOCK (INTERPROCESS) LOCKS