Lines Matching defs:ErrorOr
1 //===- llvm/Support/ErrorOr.h - Error Smart Pointer -------------*- C++ -*-===//
12 /// Provides ErrorOr<T> smart pointer.
40 /// ErrorOr<T> is a pointer-like class that represents the result of an
48 /// ErrorOr<Buffer> getBuffer();
68 class ErrorOr {
69 template <class OtherT> friend class ErrorOr;
84 ErrorOr(E ErrorCode,
92 ErrorOr(std::error_code EC) : HasError(true) {
97 ErrorOr(OtherT &&Val,
104 ErrorOr(const ErrorOr &Other) {
109 ErrorOr(
110 const ErrorOr<OtherT> &Other,
117 explicit ErrorOr(
118 const ErrorOr<OtherT> &Other,
124 ErrorOr(ErrorOr &&Other) {
129 ErrorOr(
130 ErrorOr<OtherT> &&Other,
139 explicit ErrorOr(
140 ErrorOr<OtherT> &&Other,
146 ErrorOr &operator=(const ErrorOr &Other) {
151 ErrorOr &operator=(ErrorOr &&Other) {
156 ~ErrorOr() {
167 const_reference get() const { return const_cast<ErrorOr<T> *>(this)->get(); }
187 void copyConstruct(const ErrorOr<OtherT> &Other) {
210 void copyAssign(const ErrorOr<OtherT> &Other) {
214 this->~ErrorOr();
215 new (this) ErrorOr(Other);
219 void moveConstruct(ErrorOr<OtherT> &&Other) {
232 void moveAssign(ErrorOr<OtherT> &&Other) {
236 this->~ErrorOr();
237 new (this) ErrorOr(std::move(Other));
268 return const_cast<ErrorOr<T> *>(this)->getErrorStorage();
282 operator==(const ErrorOr<T> &Err, E Code) {