From 42819c64c21dd164b564093237f9f519be7dc228 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Thu, 28 May 2015 16:43:14 +0200 Subject: [PATCH] eliminate noexept from our filesystem because a compiler without filesystem is not C++11 complete anyway We will go with noexeot when we will have std::filesystem... --- include/nana/config.hpp | 23 +++++++++++++-------- include/nana/filesystem/filesystem.hpp | 28 +++++++++++++------------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/include/nana/config.hpp b/include/nana/config.hpp index fecf633f..58d1ffad 100644 --- a/include/nana/config.hpp +++ b/include/nana/config.hpp @@ -15,14 +15,21 @@ #if defined(_MSC_VER) -#if (_MSC_VER == 1900) - // google: break any code that tries to use codecvt or codecvt. - // google: It appears the C++ libs haven't been compiled with native char16_t/char32_t support. - // google: Those definitions are for codecvt::id, codecvt::id and codecvt::id respectively. - // However, the codecvt::id and codecvt::id definitions aren't there, and indeed, if you look at locale0.cpp in the CRT source code you'll see they're not defined at all. - // google: That's a known issue, tracked by an active bug (DevDiv#1060849). We were able to update the STL's headers in response to char16_t/char32_t, but we still need to update the separately compiled sources. -#define STD_CODECVT_NOT_SUPPORTED -#endif // _MSC_VER == 1900 + #define _SCL_SECURE_NO_WARNINGS + #define _CRT_SECURE_NO_DEPRECATE + #pragma warning(disable : 4996) + #if (_MSC_VER < 1900) + // is this a good idea? + #define NOT_IMPLEMENTED_KEYWORD_noexcept + #endif // _MSC_VER < 1900 + #if (_MSC_VER == 1900) + // google: break any code that tries to use codecvt or codecvt. + // google: It appears the C++ libs haven't been compiled with native char16_t/char32_t support. + // google: Those definitions are for codecvt::id, codecvt::id and codecvt::id respectively. + // However, the codecvt::id and codecvt::id definitions aren't there, and indeed, if you look at locale0.cpp in the CRT source code you'll see they're not defined at all. + // google: That's a known issue, tracked by an active bug (DevDiv#1060849). We were able to update the STL's headers in response to char16_t/char32_t, but we still need to update the separately compiled sources. + #define STD_CODECVT_NOT_SUPPORTED + #endif // _MSC_VER == 1900 #endif // _MSVC //Select platform automatically diff --git a/include/nana/filesystem/filesystem.hpp b/include/nana/filesystem/filesystem.hpp index 658579fd..b00760d2 100644 --- a/include/nana/filesystem/filesystem.hpp +++ b/include/nana/filesystem/filesystem.hpp @@ -102,26 +102,26 @@ namespace filesystem perms m_prms = perms::unknown; public: - explicit file_status(file_type ft = file_type::none, perms prms = perms::unknown) noexcept + explicit file_status(file_type ft = file_type::none, perms prms = perms::unknown) :m_ft{ft}, m_prms{prms} {} - file_status(const file_status& fs) noexcept: m_ft{fs.m_ft}, m_prms{fs.m_prms}{} // = default; - file_status(file_status&& fs) noexcept: m_ft{fs.m_ft}, m_prms{fs.m_prms}{} // = default; + file_status(const file_status& fs) : m_ft{fs.m_ft}, m_prms{fs.m_prms}{} // = default; + file_status(file_status&& fs) : m_ft{fs.m_ft}, m_prms{fs.m_prms}{} // = default; ~file_status(){}; - file_status& operator=(const file_status&) noexcept = default; - file_status& operator=(file_status&&fs) noexcept // = default; + file_status& operator=(const file_status&) = default; + file_status& operator=(file_status&&fs) // = default; { m_ft=fs.m_ft; m_prms = fs.m_prms; return *this; } // observers - file_type type() const noexcept{ return m_ft;} - perms permissions() const noexcept{ return m_prms;} + file_type type() const { return m_ft;} + perms permissions() const { return m_prms;} // modifiers - void type (file_type ft) noexcept { m_ft=ft ;} - void permissions(perms prms) noexcept { m_prms = prms; } + void type (file_type ft) { m_ft=ft ;} + void permissions(perms prms) { m_prms = prms; } }; /// concerned only with lexical and syntactic aspects and does not necessarily exist in @@ -174,8 +174,8 @@ namespace filesystem //file_status status() const; - operator const path&() const noexcept{return m_path;}; - const path& path() const noexcept{return m_path;} + operator const path&() const {return m_path;}; + const path& path() const {return m_path;} }; @@ -219,8 +219,8 @@ namespace filesystem // enable directory_iterator range-based for statements - directory_iterator begin( ) noexcept { return *this; } - directory_iterator end( ) noexcept { return {}; } + directory_iterator begin( ) { return *this; } + directory_iterator end( ) { return {}; } private: template @@ -405,7 +405,7 @@ namespace filesystem // file_status status(const path& p); bool file_attrib(const nana::string& file, attribute&); - inline bool is_directory(file_status s) noexcept{ return s.type() == file_type::directory ;} + inline bool is_directory(file_status s) { return s.type() == file_type::directory ;} inline bool is_directory(const path& p) { return directory_iterator{ p }->attr.directory; }//works?? inline bool is_directory(const directory_entry& d) { return d.attr.directory; } //bool is_directory(const path& p, error_code& ec) noexcept;