make_error_condition.pass.cpp 913 B

123456789101112131415161718192021222324252627282930313233
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // UNSUPPORTED: libcpp-has-no-threads
  10. // <future>
  11. // class error_condition
  12. // error_condition make_error_condition(future_errc e);
  13. #include <future>
  14. #include <cassert>
  15. #include "test_macros.h"
  16. int main(int, char**)
  17. {
  18. {
  19. const std::error_condition ec1 =
  20. std::make_error_condition(std::future_errc::future_already_retrieved);
  21. assert(ec1.value() ==
  22. static_cast<int>(std::future_errc::future_already_retrieved));
  23. assert(ec1.category() == std::future_category());
  24. }
  25. return 0;
  26. }