expected 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // -*- C++ -*-
  2. //===----------------------------------------------------------------------===//
  3. //
  4. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. // See https://llvm.org/LICENSE.txt for license information.
  6. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #ifndef _LIBCPP_EXPECTED
  10. #define _LIBCPP_EXPECTED
  11. /*
  12. Header <expected> synopsis
  13. namespace std {
  14. // [expected.unexpected], class template unexpected
  15. template<class E> class unexpected;
  16. // [expected.bad], class template bad_expected_access
  17. template<class E> class bad_expected_access;
  18. // [expected.bad.void], specialization for void
  19. template<> class bad_expected_access<void>;
  20. // in-place construction of unexpected values
  21. struct unexpect_t {
  22. explicit unexpect_t() = default;
  23. };
  24. inline constexpr unexpect_t unexpect{};
  25. // [expected.expected], class template expected
  26. template<class T, class E> class expected;
  27. // [expected.void], partial specialization of expected for void types
  28. template<class T, class E> requires is_void_v<T> class expected<T, E>;
  29. }
  30. */
  31. #include <__config>
  32. #include <__expected/bad_expected_access.h>
  33. #include <__expected/expected.h>
  34. #include <__expected/unexpect.h>
  35. #include <__expected/unexpected.h>
  36. #include <version>
  37. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  38. # pragma GCC system_header
  39. #endif
  40. #endif // _LIBCPP_EXPECTED