diff --git a/include/tmp/file b/include/tmp/file index 986235f..bb4a84a 100644 --- a/include/tmp/file +++ b/include/tmp/file @@ -80,8 +80,7 @@ public: /// Returns the size of this file /// @param[out] ec Parameter for error reporting /// @returns the size of this file, in bytes - /// @throws std::filesystem::filesystem_error if cannot get a file size - std::uintmax_t size(std::error_code& ec) const; + std::uintmax_t size(std::error_code& ec) const noexcept; /// Reads the entire contents of this file /// @returns A string with this file contents diff --git a/src/file.cpp b/src/file.cpp index 7ab3d17..8d61ad4 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -143,7 +143,7 @@ std::uintmax_t file::size() const { return result; } -std::uintmax_t file::size(std::error_code& ec) const { +std::uintmax_t file::size(std::error_code& ec) const noexcept { #ifdef _WIN32 LARGE_INTERGER size; if (!GetFileSize(native_handle(), &size)) {