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...
This commit is contained in:
qPCR4vir 2015-05-28 16:43:14 +02:00
parent 9fbabadd78
commit 42819c64c2
2 changed files with 29 additions and 22 deletions

View File

@ -15,14 +15,21 @@
#if defined(_MSC_VER) #if defined(_MSC_VER)
#if (_MSC_VER == 1900) #define _SCL_SECURE_NO_WARNINGS
// google: break any code that tries to use codecvt<char16_t> or codecvt<char32_t>. #define _CRT_SECURE_NO_DEPRECATE
// google: It appears the C++ libs haven't been compiled with native char16_t/char32_t support. #pragma warning(disable : 4996)
// google: Those definitions are for codecvt<wchar_t>::id, codecvt<unsigned short>::id and codecvt<char>::id respectively. #if (_MSC_VER < 1900)
// However, the codecvt<char16_t>::id and codecvt<char32_t>::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. // is this a good idea?
// 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 NOT_IMPLEMENTED_KEYWORD_noexcept
#define STD_CODECVT_NOT_SUPPORTED #endif // _MSC_VER < 1900
#endif // _MSC_VER == 1900 #if (_MSC_VER == 1900)
// google: break any code that tries to use codecvt<char16_t> or codecvt<char32_t>.
// google: It appears the C++ libs haven't been compiled with native char16_t/char32_t support.
// google: Those definitions are for codecvt<wchar_t>::id, codecvt<unsigned short>::id and codecvt<char>::id respectively.
// However, the codecvt<char16_t>::id and codecvt<char32_t>::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 #endif // _MSVC
//Select platform automatically //Select platform automatically

View File

@ -102,26 +102,26 @@ namespace filesystem
perms m_prms = perms::unknown; perms m_prms = perms::unknown;
public: 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} :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(const file_status& fs) : 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(file_status&& fs) : m_ft{fs.m_ft}, m_prms{fs.m_prms}{} // = default;
~file_status(){}; ~file_status(){};
file_status& operator=(const file_status&) noexcept = default; file_status& operator=(const file_status&) = default;
file_status& operator=(file_status&&fs) noexcept // = default; file_status& operator=(file_status&&fs) // = default;
{ {
m_ft=fs.m_ft; m_prms = fs.m_prms; m_ft=fs.m_ft; m_prms = fs.m_prms;
return *this; return *this;
} }
// observers // observers
file_type type() const noexcept{ return m_ft;} file_type type() const { return m_ft;}
perms permissions() const noexcept{ return m_prms;} perms permissions() const { return m_prms;}
// modifiers // modifiers
void type (file_type ft) noexcept { m_ft=ft ;} void type (file_type ft) { m_ft=ft ;}
void permissions(perms prms) noexcept { m_prms = prms; } void permissions(perms prms) { m_prms = prms; }
}; };
/// concerned only with lexical and syntactic aspects and does not necessarily exist in /// concerned only with lexical and syntactic aspects and does not necessarily exist in
@ -174,8 +174,8 @@ namespace filesystem
//file_status status() const; //file_status status() const;
operator const path&() const noexcept{return m_path;}; operator const path&() const {return m_path;};
const path& path() const noexcept{return m_path;} const path& path() const {return m_path;}
}; };
@ -219,8 +219,8 @@ namespace filesystem
// enable directory_iterator range-based for statements // enable directory_iterator range-based for statements
directory_iterator begin( ) noexcept { return *this; } directory_iterator begin( ) { return *this; }
directory_iterator end( ) noexcept { return {}; } directory_iterator end( ) { return {}; }
private: private:
template<typename Char> template<typename Char>
@ -405,7 +405,7 @@ namespace filesystem
// file_status status(const path& p); // file_status status(const path& p);
bool file_attrib(const nana::string& file, attribute&); 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 path& p) { return directory_iterator{ p }->attr.directory; }//works??
inline bool is_directory(const directory_entry& d) { return d.attr.directory; } inline bool is_directory(const directory_entry& d) { return d.attr.directory; }
//bool is_directory(const path& p, error_code& ec) noexcept; //bool is_directory(const path& p, error_code& ec) noexcept;