Commit 9c476ad4 by Jonathan Wakely Committed by Jonathan Wakely

Add noexcept to Filesystem TS operators

	* include/experimental/bits/fs_fwd.h (operator&, operator|, operator^,
	operator~ operator&=, operator|=, operator^=): Add noexcept to
	overloaded operators for copy_options, perms and directory_options.
	* src/filesystem/ops.cc (make_file_type, make_file_status,
	is_not_found_errno, file_time): Add noexcept.

From-SVN: r235214
parent b1e47084
2016-04-19 Jonathan Wakely <jwakely@redhat.com>
* include/experimental/bits/fs_fwd.h (operator&, operator|, operator^,
operator~ operator&=, operator|=, operator^=): Add noexcept to
overloaded operators for copy_options, perms and directory_options.
* src/filesystem/ops.cc (make_file_type, make_file_status,
is_not_found_errno, file_time): Add noexcept.
2016-04-19 Edward Smith-Rowland <3dw4rd@verizon.net> 2016-04-19 Edward Smith-Rowland <3dw4rd@verizon.net>
* include/bits/c++14_warning.h: Do not refer C++14 as experimental. * include/bits/c++14_warning.h: Do not refer C++14 as experimental.
......
...@@ -93,7 +93,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 ...@@ -93,7 +93,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
}; };
constexpr copy_options constexpr copy_options
operator&(copy_options __x, copy_options __y) operator&(copy_options __x, copy_options __y) noexcept
{ {
using __utype = typename std::underlying_type<copy_options>::type; using __utype = typename std::underlying_type<copy_options>::type;
return static_cast<copy_options>( return static_cast<copy_options>(
...@@ -101,7 +101,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 ...@@ -101,7 +101,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
} }
constexpr copy_options constexpr copy_options
operator|(copy_options __x, copy_options __y) operator|(copy_options __x, copy_options __y) noexcept
{ {
using __utype = typename std::underlying_type<copy_options>::type; using __utype = typename std::underlying_type<copy_options>::type;
return static_cast<copy_options>( return static_cast<copy_options>(
...@@ -109,7 +109,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 ...@@ -109,7 +109,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
} }
constexpr copy_options constexpr copy_options
operator^(copy_options __x, copy_options __y) operator^(copy_options __x, copy_options __y) noexcept
{ {
using __utype = typename std::underlying_type<copy_options>::type; using __utype = typename std::underlying_type<copy_options>::type;
return static_cast<copy_options>( return static_cast<copy_options>(
...@@ -117,22 +117,22 @@ _GLIBCXX_END_NAMESPACE_CXX11 ...@@ -117,22 +117,22 @@ _GLIBCXX_END_NAMESPACE_CXX11
} }
constexpr copy_options constexpr copy_options
operator~(copy_options __x) operator~(copy_options __x) noexcept
{ {
using __utype = typename std::underlying_type<copy_options>::type; using __utype = typename std::underlying_type<copy_options>::type;
return static_cast<copy_options>(~static_cast<__utype>(__x)); return static_cast<copy_options>(~static_cast<__utype>(__x));
} }
inline copy_options& inline copy_options&
operator&=(copy_options& __x, copy_options __y) operator&=(copy_options& __x, copy_options __y) noexcept
{ return __x = __x & __y; } { return __x = __x & __y; }
inline copy_options& inline copy_options&
operator|=(copy_options& __x, copy_options __y) operator|=(copy_options& __x, copy_options __y) noexcept
{ return __x = __x | __y; } { return __x = __x | __y; }
inline copy_options& inline copy_options&
operator^=(copy_options& __x, copy_options __y) operator^=(copy_options& __x, copy_options __y) noexcept
{ return __x = __x ^ __y; } { return __x = __x ^ __y; }
...@@ -163,7 +163,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 ...@@ -163,7 +163,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
}; };
constexpr perms constexpr perms
operator&(perms __x, perms __y) operator&(perms __x, perms __y) noexcept
{ {
using __utype = typename std::underlying_type<perms>::type; using __utype = typename std::underlying_type<perms>::type;
return static_cast<perms>( return static_cast<perms>(
...@@ -171,7 +171,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 ...@@ -171,7 +171,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
} }
constexpr perms constexpr perms
operator|(perms __x, perms __y) operator|(perms __x, perms __y) noexcept
{ {
using __utype = typename std::underlying_type<perms>::type; using __utype = typename std::underlying_type<perms>::type;
return static_cast<perms>( return static_cast<perms>(
...@@ -179,7 +179,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 ...@@ -179,7 +179,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
} }
constexpr perms constexpr perms
operator^(perms __x, perms __y) operator^(perms __x, perms __y) noexcept
{ {
using __utype = typename std::underlying_type<perms>::type; using __utype = typename std::underlying_type<perms>::type;
return static_cast<perms>( return static_cast<perms>(
...@@ -187,22 +187,22 @@ _GLIBCXX_END_NAMESPACE_CXX11 ...@@ -187,22 +187,22 @@ _GLIBCXX_END_NAMESPACE_CXX11
} }
constexpr perms constexpr perms
operator~(perms __x) operator~(perms __x) noexcept
{ {
using __utype = typename std::underlying_type<perms>::type; using __utype = typename std::underlying_type<perms>::type;
return static_cast<perms>(~static_cast<__utype>(__x)); return static_cast<perms>(~static_cast<__utype>(__x));
} }
inline perms& inline perms&
operator&=(perms& __x, perms __y) operator&=(perms& __x, perms __y) noexcept
{ return __x = __x & __y; } { return __x = __x & __y; }
inline perms& inline perms&
operator|=(perms& __x, perms __y) operator|=(perms& __x, perms __y) noexcept
{ return __x = __x | __y; } { return __x = __x | __y; }
inline perms& inline perms&
operator^=(perms& __x, perms __y) operator^=(perms& __x, perms __y) noexcept
{ return __x = __x ^ __y; } { return __x = __x ^ __y; }
// Bitmask type // Bitmask type
...@@ -211,7 +211,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 ...@@ -211,7 +211,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
}; };
constexpr directory_options constexpr directory_options
operator&(directory_options __x, directory_options __y) operator&(directory_options __x, directory_options __y) noexcept
{ {
using __utype = typename std::underlying_type<directory_options>::type; using __utype = typename std::underlying_type<directory_options>::type;
return static_cast<directory_options>( return static_cast<directory_options>(
...@@ -219,7 +219,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 ...@@ -219,7 +219,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
} }
constexpr directory_options constexpr directory_options
operator|(directory_options __x, directory_options __y) operator|(directory_options __x, directory_options __y) noexcept
{ {
using __utype = typename std::underlying_type<directory_options>::type; using __utype = typename std::underlying_type<directory_options>::type;
return static_cast<directory_options>( return static_cast<directory_options>(
...@@ -227,7 +227,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 ...@@ -227,7 +227,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
} }
constexpr directory_options constexpr directory_options
operator^(directory_options __x, directory_options __y) operator^(directory_options __x, directory_options __y) noexcept
{ {
using __utype = typename std::underlying_type<directory_options>::type; using __utype = typename std::underlying_type<directory_options>::type;
return static_cast<directory_options>( return static_cast<directory_options>(
...@@ -235,22 +235,22 @@ _GLIBCXX_END_NAMESPACE_CXX11 ...@@ -235,22 +235,22 @@ _GLIBCXX_END_NAMESPACE_CXX11
} }
constexpr directory_options constexpr directory_options
operator~(directory_options __x) operator~(directory_options __x) noexcept
{ {
using __utype = typename std::underlying_type<directory_options>::type; using __utype = typename std::underlying_type<directory_options>::type;
return static_cast<directory_options>(~static_cast<__utype>(__x)); return static_cast<directory_options>(~static_cast<__utype>(__x));
} }
inline directory_options& inline directory_options&
operator&=(directory_options& __x, directory_options __y) operator&=(directory_options& __x, directory_options __y) noexcept
{ return __x = __x & __y; } { return __x = __x & __y; }
inline directory_options& inline directory_options&
operator|=(directory_options& __x, directory_options __y) operator|=(directory_options& __x, directory_options __y) noexcept
{ return __x = __x | __y; } { return __x = __x | __y; }
inline directory_options& inline directory_options&
operator^=(directory_options& __x, directory_options __y) operator^=(directory_options& __x, directory_options __y) noexcept
{ return __x = __x ^ __y; } { return __x = __x ^ __y; }
typedef chrono::time_point<chrono::system_clock> file_time_type; typedef chrono::time_point<chrono::system_clock> file_time_type;
......
...@@ -249,7 +249,7 @@ namespace ...@@ -249,7 +249,7 @@ namespace
typedef struct ::stat stat_type; typedef struct ::stat stat_type;
inline fs::file_type inline fs::file_type
make_file_type(const stat_type& st) make_file_type(const stat_type& st) noexcept
{ {
using fs::file_type; using fs::file_type;
#ifdef _GLIBCXX_HAVE_S_ISREG #ifdef _GLIBCXX_HAVE_S_ISREG
...@@ -273,7 +273,7 @@ namespace ...@@ -273,7 +273,7 @@ namespace
} }
inline fs::file_status inline fs::file_status
make_file_status(const stat_type& st) make_file_status(const stat_type& st) noexcept
{ {
return fs::file_status{ return fs::file_status{
make_file_type(st), make_file_type(st),
...@@ -282,13 +282,13 @@ namespace ...@@ -282,13 +282,13 @@ namespace
} }
inline bool inline bool
is_not_found_errno(int err) is_not_found_errno(int err) noexcept
{ {
return err == ENOENT || err == ENOTDIR; return err == ENOENT || err == ENOTDIR;
} }
inline fs::file_time_type inline fs::file_time_type
file_time(const stat_type& st) file_time(const stat_type& st) noexcept
{ {
using namespace std::chrono; using namespace std::chrono;
return fs::file_time_type{ return fs::file_time_type{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment