Lines Matching defs:Expected
39 template <typename T> friend class Expected;
185 template <typename T> class ORC_RT_NODISCARD Expected {
187 template <class OtherT> friend class Expected;
201 /// Create an Expected from a failure value.
202 Expected(Error Err) : HasError(true), Unchecked(true) {
203 assert(Err && "Cannot create Expected<T> from Error success value");
207 /// Create an Expected from a T value.
209 Expected(OtherT &&Val,
215 /// Move-construct an Expected<T> from an Expected<OtherT>.
216 Expected(Expected &&Other) { moveConstruct(std::move(Other)); }
218 /// Move construct an Expected<T> value from an Expected<OtherT>, where OtherT
221 Expected(
222 Expected<OtherT> &&Other,
227 /// Move construct an Expected<T> value from an Expected<OtherT>, where OtherT
230 explicit Expected(
231 Expected<OtherT> &&Other,
236 /// Move-assign from another Expected<T>.
237 Expected &operator=(Expected &&Other) {
242 /// Destroy an Expected<T>.
243 ~Expected() {
251 /// Returns true if this Expected value is in a success state (holding a T),
252 /// and false if this Expected value is in a failure state.
258 /// Returns true if this Expected value holds an Error of type error_type.
265 /// If this Expected value is in a success state (holding a T) then this
268 /// If thsi Expected value is in a failure state (holding an Error) then this
269 /// method returns the contained error and leaves this Expected in an
312 template <class OtherT> void moveConstruct(Expected<OtherT> &&Other) {
323 template <class OtherT> void moveAssign(Expected<OtherT> &&Other) {
329 this->~Expected();
330 new (this) Expected(std::move(Other));
364 "Expected<T> must be checked before access or destruction.\n");
391 /// Auto-unwrap an Expected<T> value in the success state. It is a programmatic
393 template <typename T> T cantFail(Expected<T> E) {
399 /// Auto-unwrap an Expected<T> value in the success state. It is a programmatic
401 template <typename T> T &cantFail(Expected<T &> E) {