proxygen
folly::expected_detail Namespace Reference

Namespaces

 expected_detail_ExpectedHelper
 

Classes

struct  CopyAssignable
 
struct  CopyAssignable< Derived, false, Noexcept >
 
struct  CopyConstructible
 
struct  CopyConstructible< Derived, false, Noexcept >
 
struct  EmptyTag
 
struct  ErrorTag
 
struct  ExpectedStorage
 
struct  ExpectedStorage< Value, Error, StorageType::ePODStruct >
 
struct  ExpectedStorage< Value, Error, StorageType::eUnion >
 
struct  ExpectedUnion
 
struct  MoveAssignable
 
struct  MoveAssignable< Derived, false, Noexcept >
 
struct  MoveConstructible
 
struct  MoveConstructible< Derived, false, Noexcept >
 
struct  PromiseReturn
 
struct  UnexpectedTag
 
struct  ValueTag
 

Typedefs

template<template< class... > class Trait, class... Ts>
using StrictAllOf = StrictConjunction< Trait< Ts >... >
 
template<class T >
using IsCopyable = StrictConjunction< std::is_copy_constructible< T >, std::is_copy_assignable< T >>
 
template<class T >
using IsMovable = StrictConjunction< std::is_move_constructible< T >, std::is_move_assignable< T >>
 
template<class T >
using IsNothrowCopyable = StrictConjunction< std::is_nothrow_copy_constructible< T >, std::is_nothrow_copy_assignable< T >>
 
template<class T >
using IsNothrowMovable = StrictConjunction< std::is_nothrow_move_constructible< T >, std::is_nothrow_move_assignable< T >>
 
template<class From , class To >
using IsConvertible = StrictConjunction< std::is_constructible< To, From >, std::is_assignable< To &, From >>
 

Enumerations

enum  Which : unsigned char { Which::eEmpty, Which::eValue, Which::eError }
 
enum  StorageType { StorageType::ePODStruct, StorageType::ePODUnion, StorageType::eUnion }
 

Functions

template<class T , class U >
auto doEmplaceAssign (int, T &t, U &&u) -> decltype(void(t=static_cast< U && >(u)))
 
template<class T , class U >
auto doEmplaceAssign (long, T &t, U &&u) -> decltype(void(T(static_cast< U && >(u))))
 
template<class T , class... Us>
auto doEmplaceAssign (int, T &t, Us &&...us) -> decltype(void(t=T(static_cast< Us && >(us)...)))
 
template<class T , class... Us>
auto doEmplaceAssign (long, T &t, Us &&...us) -> decltype(void(T(static_cast< Us && >(us)...)))
 
template<class Value , class Error >
constexpr StorageType getStorageType ()
 

Typedef Documentation

template<class From , class To >
using folly::expected_detail::IsConvertible = typedef StrictConjunction< std::is_constructible<To, From>, std::is_assignable<To&, From>>

Definition at line 137 of file Expected.h.

template<class T >
using folly::expected_detail::IsCopyable = typedef StrictConjunction< std::is_copy_constructible<T>, std::is_copy_assignable<T>>

Definition at line 117 of file Expected.h.

template<class T >
using folly::expected_detail::IsMovable = typedef StrictConjunction< std::is_move_constructible<T>, std::is_move_assignable<T>>

Definition at line 122 of file Expected.h.

template<class T >
using folly::expected_detail::IsNothrowCopyable = typedef StrictConjunction< std::is_nothrow_copy_constructible<T>, std::is_nothrow_copy_assignable<T>>

Definition at line 127 of file Expected.h.

template<class T >
using folly::expected_detail::IsNothrowMovable = typedef StrictConjunction< std::is_nothrow_move_constructible<T>, std::is_nothrow_move_assignable<T>>

Definition at line 132 of file Expected.h.

template<template< class... > class Trait, class... Ts>
using folly::expected_detail::StrictAllOf = typedef StrictConjunction<Trait<Ts>...>

Definition at line 111 of file Expected.h.

Enumeration Type Documentation

enum folly::expected_detail::Which : unsigned char
strong
Enumerator
eEmpty 
eValue 
eError 

Definition at line 168 of file Expected.h.

Function Documentation

template<class T , class U >
auto folly::expected_detail::doEmplaceAssign ( long  ,
T t,
U &&  u 
) -> decltype(void(T(static_cast<U&&>(u))))

Definition at line 146 of file Expected.h.

References folly::pushmi::detail::t, and folly::T.

147  {
148  t.~T();
149  ::new ((void*)std::addressof(t)) T(static_cast<U&&>(u));
150 }
#define T(v)
Definition: http_parser.c:233
template<class T , class... Us>
auto folly::expected_detail::doEmplaceAssign ( int  ,
T t,
Us &&...  us 
) -> decltype(void(t = T(static_cast<Us&&>(us)...)))

Definition at line 153 of file Expected.h.

References folly::pushmi::detail::t, folly::T, and us.

154  {
155  t = T(static_cast<Us&&>(us)...);
156 }
#define T(v)
Definition: http_parser.c:233
static unordered_set< string > us
template<class T , class... Us>
auto folly::expected_detail::doEmplaceAssign ( long  ,
T t,
Us &&...  us 
) -> decltype(void(T(static_cast<Us&&>(us)...)))

Definition at line 159 of file Expected.h.

References folly::pushmi::detail::t, folly::T, and us.

160  {
161  t.~T();
162  ::new ((void*)std::addressof(t)) T(static_cast<Us&&>(us)...);
163 }
#define T(v)
Definition: http_parser.c:233
static unordered_set< string > us
template<class Value , class Error >
constexpr StorageType folly::expected_detail::getStorageType ( )

Definition at line 172 of file Expected.h.

References ePODStruct, ePODUnion, eUnion, and testing::Value().

172  {
174  ? (sizeof(std::pair<Value, Error>) <= sizeof(void * [2]) &&
176  ? StorageType::ePODStruct
177  : StorageType::ePODUnion)
178  : StorageType::eUnion;
179 }
static const char *const value
Definition: Conv.cpp:50