Namespaces
Variants

Experimental library header <experimental/optional>

From cppreference.net
Standard library headers
Experimental library headers
Execution P2300
<experimental/execution>
Filesystem TS
<experimental/filesystem>
Parallelism TS (v1, v2)
experimental/algorithm
experimental/execution_policy
experimental/exception_list
experimental/numeric
<experimental/simd>
experimental/task_block
Library Fundamentals TS (v1, v2, v3)
experimental/algorithm
<experimental/any>
experimental/array
experimental/chrono
experimental/deque
experimental/forward_list
<experimental/functional>
experimental/future
experimental/iterator
experimental/list
experimental/map
experimental/memory
<experimental/memory_resource>
experimental/numeric
<experimental/optional>
experimental/propagate_const
experimental/random
experimental/ratio
experimental/regex
experimental/scope
experimental/set
experimental/source_location
experimental/string
<experimental/string_view>
experimental/system_error
experimental/tuple
experimental/type_traits
experimental/unordered_map
experimental/unordered_set
experimental/utility
experimental/vector

Concurrency TS
experimental/atomic
experimental/barrier
experimental/future
experimental/latch
Ranges TS
Coroutines TS
experimental/coroutine
Networking TS
experimental/buffer
experimental/executor
experimental/internet
experimental/io_context
<experimental/net>
experimental/netfwd
experimental/socket
experimental/timer
Reflection TS
<experimental/reflect>

이 헤더는 Library Fundamentals TS( v1 , v2 )의 일부입니다.

목차

클래스

이름 설명
(library fundamentals TS)
객체를 보유할 수도 있고 보유하지 않을 수도 있는 래퍼
(클래스 템플릿)
(library fundamentals TS)
값을 포함하지 않는 optional에 대한 검사된 접근을 나타내는 예외
(클래스)
(library fundamentals TS)
optional 타입의 인-플레이스 생성용 구분 태그 타입
(클래스)
std::hash 알고리즘을 특수화함
(클래스 템플릿 특수화)
(library fundamentals TS)
초기화되지 않은 상태의 optional 타입을 나타내는 표시자
(클래스)

함수

비교
optional 객체 비교
(함수 템플릿)
특화된 알고리즘
std::swap 알고리즘 특수화
(함수)
optional 객체 생성
(함수 템플릿)
해시 지원

시놉시스

namespace std {
  namespace experimental {
  inline namespace fundamentals_v1 {
    // 5.4, 객체 타입에 대한 선택적
    template <class T> class optional;
    // 5.5, In-place construction
    struct in_place_t{};
    constexpr in_place_t in_place{};
    // 5.6, Disengaged state indicator
    struct nullopt_t{see below};
    constexpr nullopt_t nullopt(unspecified);
    // 5.7, Class bad_optional_access
    class bad_optional_access;
    // 5.8, 관계 연산자
    template <class T>
      constexpr bool operator==(const optional<T>&, const optional<T>&);
    template <class T>
      constexpr bool operator!=(const optional<T>&, const optional<T>&);
    template <class T>
      constexpr bool operator<(const optional<T>&, const optional<T>&);
    template <class T>
      constexpr bool operator>(const optional<T>&, const optional<T>&);
    template <class T>
      constexpr bool operator<=(const optional<T>&, const optional<T>&);
    template <class T>
      constexpr bool operator>=(const optional<T>&, const optional<T>&);
    // 5.9, nullopt와의 비교
    template <class T> constexpr bool operator==(const optional<T>&, nullopt_t) noexcept;
    template <class T> constexpr bool operator==(nullopt_t, const optional<T>&) noexcept;
    template <class T> constexpr bool operator!=(const optional<T>&, nullopt_t) noexcept;
    template <class T> constexpr bool operator!=(nullopt_t, const optional<T>&) noexcept;
    template <class T> constexpr bool operator<(const optional<T>&, nullopt_t) noexcept;
    template <class T> constexpr bool operator<(nullopt_t, const optional<T>&) noexcept;
    template <class T> constexpr bool operator<=(const optional<T>&, nullopt_t) noexcept;
    template <class T> constexpr bool operator<=(nullopt_t, const optional<T>&) noexcept;
    template <class T> constexpr bool operator>(const optional<T>&, nullopt_t) noexcept;
    template <class T> constexpr bool operator>(nullopt_t, const optional<T>&) noexcept;
    template <class T> constexpr bool operator>=(const optional<T>&, nullopt_t) noexcept;
    template <class T> constexpr bool operator>=(nullopt_t, const optional<T>&) noexcept;
    // 5.10, T와의 비교
    template <class T> constexpr bool operator==(const optional<T>&, const T&);
    template <class T> constexpr bool operator==(const T&, const optional<T>&);
    template <class T> constexpr bool operator!=(const optional<T>&, const T&);
    template <class T> constexpr bool operator!=(const T&, const optional<T>&);
    template <class T> constexpr bool operator<(const optional<T>&, const T&);
    template <class T> constexpr bool operator<(const T&, const optional<T>&);
    template <class T> constexpr bool operator<=(const optional<T>&, const T&);
    template <class T> constexpr bool operator<=(const T&, const optional<T>&);
    template <class T> constexpr bool operator>(const optional<T>&, const T&);
    template <class T> constexpr bool operator>(const T&, const optional<T>&);
    template <class T> constexpr bool operator>=(const optional<T>&, const T&);
    template <class T> constexpr bool operator>=(const T&, const optional<T>&);
    // 5.11, 특수화된 알고리즘
    template <class T> void swap(optional<T>&, optional<T>&) noexcept(see below);
    template <class T> constexpr optional<see below> make_optional(T&&);
  } // namespace fundamentals_v1
  } // namespace experimental
  // 5.12, 해시 지원
  template <class T> struct hash;
  template <class T> struct hash<experimental::optional<T>>;
} // namespace std