[IRBuilder] Refactor FMF interface (#121657)
[llvm-project.git] / libcxx / include / expected
blob38038d328f17d07e0b0b74659f333ec6247c6c7e
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 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP_EXPECTED
11 #define _LIBCPP_EXPECTED
14   Header <expected> synopsis
16 namespace std {
17   // [expected.unexpected], class template unexpected
18   template<class E> class unexpected;
20   // [expected.bad], class template bad_expected_access
21   template<class E> class bad_expected_access;
23   // [expected.bad.void], specialization for void
24   template<> class bad_expected_access<void>;
26   // in-place construction of unexpected values
27   struct unexpect_t {
28     explicit unexpect_t() = default;
29   };
30   inline constexpr unexpect_t unexpect{};
32   // [expected.expected], class template expected
33   template<class T, class E> class expected;
35   // [expected.void], partial specialization of expected for void types
36   template<class T, class E> requires is_void_v<T> class expected<T, E>;
41 #if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
42 #  include <__cxx03/expected>
43 #else
44 #  include <__config>
46 #  if _LIBCPP_STD_VER >= 23
47 #    include <__expected/bad_expected_access.h>
48 #    include <__expected/expected.h>
49 #    include <__expected/unexpect.h>
50 #    include <__expected/unexpected.h>
51 #  endif
53 #  include <version>
55 #  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
56 #    pragma GCC system_header
57 #  endif
58 #endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
60 #endif // _LIBCPP_EXPECTED