summaryrefslogtreecommitdiffstats
path: root/libcxx/include/system_error
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2016-09-24 17:36:14 +0000
committerMarshall Clow <mclow.lists@gmail.com>2016-09-24 17:36:14 +0000
commite69a08ba6d2305b002f70ded1d60de4a17ca06cc (patch)
treec55f58826c7a398f4721c56b4161344e6e7bf1be /libcxx/include/system_error
parent41a83a7d2b654de40bc623821ff111e56191236c (diff)
downloadbcm5719-llvm-e69a08ba6d2305b002f70ded1d60de4a17ca06cc.tar.gz
bcm5719-llvm-e69a08ba6d2305b002f70ded1d60de4a17ca06cc.zip
Implement is_error_code_v and is_error_condition_v for c++17. Rework the tests for is_error_code and is_error_condition, since they were really lacking. Thanks to Alisdair for the heads-up that we were missing these.
llvm-svn: 282331
Diffstat (limited to 'libcxx/include/system_error')
-rw-r--r--libcxx/include/system_error16
1 files changed, 16 insertions, 0 deletions
diff --git a/libcxx/include/system_error b/libcxx/include/system_error
index 5145d23e630..faaeaa06d05 100644
--- a/libcxx/include/system_error
+++ b/libcxx/include/system_error
@@ -46,6 +46,12 @@ template <class T> struct is_error_code_enum
template <class T> struct is_error_condition_enum
: public false_type {};
+template <class _Tp>
+constexpr size_t is_error_condition_enum_v = is_error_condition_enum<_Tp>::value; // C++17
+
+template <class _Tp>
+constexpr size_t is_error_code_enum_v = is_error_code_enum<_Tp>::value; // C++17
+
class error_code
{
public:
@@ -236,12 +242,22 @@ template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_error_code_enum
: public false_type {};
+#if _LIBCPP_STD_VER > 14
+template <class _Tp>
+constexpr size_t is_error_code_enum_v = is_error_code_enum<_Tp>::value;
+#endif
+
// is_error_condition_enum
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_error_condition_enum
: public false_type {};
+#if _LIBCPP_STD_VER > 14
+template <class _Tp>
+constexpr size_t is_error_condition_enum_v = is_error_condition_enum<_Tp>::value;
+#endif
+
// Some error codes are not present on all platforms, so we provide equivalents
// for them:
OpenPOWER on IntegriCloud