proxygen
folly::Unexpected< Error > Class Template Reference

#include <Expected.h>

Inheritance diagram for folly::Unexpected< Error >:

Classes

class  BadExpectedAccess
 
struct  MakeBadExpectedAccess
 

Public Member Functions

 Unexpected ()=default
 
 Unexpected (const Unexpected &)=default
 
 Unexpected (Unexpected &&)=default
 
Unexpectedoperator= (const Unexpected &)=default
 
Unexpectedoperator= (Unexpected &&)=default
 
constexpr Unexpected (const Error &err)
 
constexpr Unexpected (Error &&err)
 
template<class Other , bool FB_CONCATENATE = false, typename std::enable_if< (FB_CONCATENATE(FB_CONCATENATE(Folly, Requires), __LINE__)||static_cast< bool >(std::is_constructible< Error, Other && >::value)), int >::type = 0>
constexpr Unexpected (Unexpected< Other > that)
 
template<class Other , bool FB_CONCATENATE = false, typename std::enable_if< (FB_CONCATENATE(FB_CONCATENATE(Folly, Requires), __LINE__)||static_cast< bool >(std::is_assignable< Error &, Other && >::value)), int >::type = 0>
Unexpectedoperator= (Unexpected< Other > that)
 
Error & error ()&
 
const Error & error () const &
 
Error && error ()&&
 

Private Attributes

Error error_
 

Friends

template<class E >
class Unexpected
 
template<class V , class E >
class Expected
 
struct expected_detail::ExpectedHelper
 

Detailed Description

template<class Error>
class folly::Unexpected< Error >

Forward declarations

Unexpected - a helper type used to disambiguate the construction of Expected objects in the error state.

Definition at line 72 of file Expected.h.

Constructor & Destructor Documentation

template<class Error>
folly::Unexpected< Error >::Unexpected ( )
default

Constructors

template<class Error>
folly::Unexpected< Error >::Unexpected ( const Unexpected< Error > &  )
default
template<class Error>
folly::Unexpected< Error >::Unexpected ( Unexpected< Error > &&  )
default
template<class Error>
constexpr folly::Unexpected< Error >::Unexpected ( const Error &  err)
inline

Definition at line 715 of file Expected.h.

715 : error_(err) {}
template<class Error>
constexpr folly::Unexpected< Error >::Unexpected ( Error &&  err)
inline

Definition at line 716 of file Expected.h.

References FOLLY_REQUIRES_TRAILING, and value.

716 : error_(std::move(err)) {}
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<class Error>
template<class Other , bool FB_CONCATENATE = false, typename std::enable_if< (FB_CONCATENATE(FB_CONCATENATE(Folly, Requires), __LINE__)||static_cast< bool >(std::is_constructible< Error, Other && >::value)), int >::type = 0>
constexpr folly::Unexpected< Error >::Unexpected ( Unexpected< Other >  that)
inline

Definition at line 720 of file Expected.h.

References FOLLY_REQUIRES_TRAILING, and value.

721  : error_(std::move(that.error())) {}
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567

Member Function Documentation

template<class Error>
Error& folly::Unexpected< Error >::error ( )
inline

Observers

Definition at line 735 of file Expected.h.

Referenced by folly::Unexpected< Error >::operator=(), and folly::operator==().

735  {
736  return error_;
737  }
template<class Error>
const Error& folly::Unexpected< Error >::error ( ) const
inline

Definition at line 738 of file Expected.h.

738  {
739  return error_;
740  }
template<class Error>
Error&& folly::Unexpected< Error >::error ( )
inline

Definition at line 741 of file Expected.h.

References folly::gen::move.

741  {
742  return std::move(error_);
743  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<class Error>
Unexpected& folly::Unexpected< Error >::operator= ( const Unexpected< Error > &  )
default
template<class Error>
Unexpected& folly::Unexpected< Error >::operator= ( Unexpected< Error > &&  )
default
template<class Error>
template<class Other , bool FB_CONCATENATE = false, typename std::enable_if< (FB_CONCATENATE(FB_CONCATENATE(Folly, Requires), __LINE__)||static_cast< bool >(std::is_assignable< Error &, Other && >::value)), int >::type = 0>
Unexpected& folly::Unexpected< Error >::operator= ( Unexpected< Other >  that)
inline

Assignment

Definition at line 728 of file Expected.h.

References folly::Unexpected< Error >::error(), and folly::gen::move.

728  {
729  error_ = std::move(that.error());
730  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567

Friends And Related Function Documentation

template<class Error>
template<class V , class E >
friend class Expected
friend

Definition at line 682 of file Expected.h.

template<class Error>
friend struct expected_detail::ExpectedHelper
friend

Definition at line 683 of file Expected.h.

template<class Error>
template<class E >
friend class Unexpected
friend

Definition at line 680 of file Expected.h.

Member Data Documentation

template<class Error>
Error folly::Unexpected< Error >::error_
private

Definition at line 753 of file Expected.h.


The documentation for this class was generated from the following file: