Make cv_status a class enum. Fixes PR18314. Thanks to Andersca for the report and the patch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@197921 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f1ebe26bdb
commit
239bc42b53
@ -254,19 +254,13 @@ void
|
||||
swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) _NOEXCEPT
|
||||
{__x.swap(__y);}
|
||||
|
||||
struct _LIBCPP_TYPE_VIS cv_status
|
||||
//enum class cv_status
|
||||
_LIBCPP_DECLARE_STRONG_ENUM(cv_status)
|
||||
{
|
||||
enum __lx {
|
||||
no_timeout,
|
||||
timeout
|
||||
};
|
||||
|
||||
__lx __v_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY cv_status(__lx __v) : __v_(__v) {}
|
||||
_LIBCPP_INLINE_VISIBILITY operator int() const {return __v_;}
|
||||
|
||||
no_timeout,
|
||||
timeout
|
||||
};
|
||||
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(cv_status)
|
||||
|
||||
class _LIBCPP_TYPE_VIS condition_variable
|
||||
{
|
||||
|
@ -16,6 +16,6 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
assert(std::cv_status::no_timeout == 0);
|
||||
assert(std::cv_status::timeout == 1);
|
||||
assert(static_cast<int>(std::cv_status::no_timeout) == 0);
|
||||
assert(static_cast<int>(std::cv_status::timeout) == 1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user