You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
libcxx_old/test/std/thread/futures/futures.overview/future_errc.pass.cpp

44 lines
1.8 KiB
C++

//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
// Libc++'s enum class emulation does not allow static_cast<Enum>(0) to work.
// <future>
// enum class future_errc
// {
// broken_promise = implementation-defined,
// future_already_retrieved = implementation-defined,
// promise_already_satisfied = implementation-defined,
// no_state = implementation-defined
// };
#include <future>
#include "test_macros.h"
int main(int, char**)
{
static_assert(std::future_errc::broken_promise != std::future_errc::future_already_retrieved, "");
static_assert(std::future_errc::broken_promise != std::future_errc::promise_already_satisfied, "");
static_assert(std::future_errc::broken_promise != std::future_errc::no_state, "");
static_assert(std::future_errc::future_already_retrieved != std::future_errc::promise_already_satisfied, "");
static_assert(std::future_errc::future_already_retrieved != std::future_errc::no_state, "");
static_assert(std::future_errc::promise_already_satisfied != std::future_errc::no_state, "");
static_assert(std::future_errc::broken_promise != static_cast<std::future_errc>(0), "");
static_assert(std::future_errc::future_already_retrieved != static_cast<std::future_errc>(0), "");
static_assert(std::future_errc::promise_already_satisfied != static_cast<std::future_errc>(0), "");
static_assert(std::future_errc::no_state != static_cast<std::future_errc>(0), "");
return 0;
}