|
template<typename S = T, typename = decltype(S())> |
constexpr | Indestructible () noexcept(noexcept(T())) |
|
template<typename U = T, _t< std::enable_if< std::is_constructible< T, U && >::value >> * = nullptr, _t< std::enable_if< !std::is_same< Indestructible< T >, remove_cvref_t< U >>::value >> * = nullptr, _t< std::enable_if<!std::is_convertible< U &&, T >::value >> * = nullptr> |
constexpr | Indestructible (U &&u) noexcept(noexcept(T(std::declval< U >()))) |
|
template<typename U = T, _t< std::enable_if< std::is_constructible< T, U && >::value >> * = nullptr, _t< std::enable_if< !std::is_same< Indestructible< T >, remove_cvref_t< U >>::value >> * = nullptr, _t< std::enable_if< std::is_convertible< U &&, T >::value >> * = nullptr> |
constexpr | Indestructible (U &&u) noexcept(noexcept(T(std::declval< U >()))) |
|
template<typename... Args, typename = decltype(T(std::declval<Args>()...))> |
constexpr | Indestructible (Args &&...args) noexcept(noexcept(T(std::declval< Args >()...))) |
|
template<typename U , typename... Args, typename = decltype( T(std::declval<std::initializer_list<U>&>(), std::declval<Args>()...))> |
constexpr | Indestructible (std::initializer_list< U > il, Args...args) noexcept(noexcept(T(std::declval< std::initializer_list< U > & >(), std::declval< Args >()...))) |
|
| ~Indestructible ()=default |
|
| Indestructible (Indestructible const &)=delete |
|
Indestructible & | operator= (Indestructible const &)=delete |
|
| Indestructible (Indestructible &&other) noexcept(noexcept(T(std::declval< T >()))) |
|
Indestructible & | operator= (Indestructible &&other) noexcept(noexcept(T(std::declval< T >()))) |
|
T * | get () noexcept |
|
T const * | get () const noexcept |
|
T & | operator* () noexcept |
|
T const & | operator* () const noexcept |
|
T * | operator-> () noexcept |
|
T const * | operator-> () const noexcept |
|
template<typename T>
class folly::Indestructible< T >
Definition at line 61 of file Indestructible.h.
template<typename T>
template<typename U = T, _t< std::enable_if< std::is_constructible< T, U && >::value >> * = nullptr, _t< std::enable_if< !std::is_same< Indestructible< T >, remove_cvref_t< U >>::value >> * = nullptr, _t< std::enable_if<!std::is_convertible< U &&, T >::value >> * = nullptr>
Constructor accepting a single argument by forwarding reference, this allows using list initialzation without the overhead of things like in_place, etc and also works with std::initializer_list constructors which can't be deduced, the default parameter helps there.
auto i = folly::Indestructible<std::map<int, int>>{{{1, 2}}};
This provides convenience
There are two versions of this constructor - one for when the element is implicitly constructible from the given argument and one for when the type is explicitly but not implicitly constructible from the given argument.
Definition at line 88 of file Indestructible.h.
References folly::T.
template<typename T>
template<typename U = T, _t< std::enable_if< std::is_constructible< T, U && >::value >> * = nullptr, _t< std::enable_if< !std::is_same< Indestructible< T >, remove_cvref_t< U >>::value >> * = nullptr, _t< std::enable_if< std::is_convertible< U &&, T >::value >> * = nullptr>