diff options
| author | somov <[email protected]> | 2022-02-10 16:45:49 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:49 +0300 |
| commit | 7489e4682331202b9c7d863c0898eb83d7b12c2b (patch) | |
| tree | 9142afc54d335ea52910662635b898e79e192e49 /util/generic/maybe.h | |
| parent | a5950576e397b1909261050b8c7da16db58f10b1 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'util/generic/maybe.h')
| -rw-r--r-- | util/generic/maybe.h | 160 |
1 files changed, 80 insertions, 80 deletions
diff --git a/util/generic/maybe.h b/util/generic/maybe.h index f250a893f90..34d21aebcdc 100644 --- a/util/generic/maybe.h +++ b/util/generic/maybe.h @@ -50,107 +50,107 @@ private: "Instantiation of TMaybe with non-destructible type is ill-formed"); template <class U> - struct TConstructibleFromMaybeSomehow { - public: - static constexpr bool value = std::is_constructible<T, TMaybe<U, Policy>&>::value || - std::is_constructible<T, const TMaybe<U, Policy>&>::value || - std::is_constructible<T, TMaybe<U, Policy>&&>::value || - std::is_constructible<T, const TMaybe<U, Policy>&&>::value || - std::is_convertible<TMaybe<U, Policy>&, T>::value || - std::is_convertible<const TMaybe<U, Policy>&, T>::value || - std::is_convertible<TMaybe<U, Policy>&&, T>::value || - std::is_convertible<const TMaybe<U, Policy>&&, T>::value; - }; + struct TConstructibleFromMaybeSomehow { + public: + static constexpr bool value = std::is_constructible<T, TMaybe<U, Policy>&>::value || + std::is_constructible<T, const TMaybe<U, Policy>&>::value || + std::is_constructible<T, TMaybe<U, Policy>&&>::value || + std::is_constructible<T, const TMaybe<U, Policy>&&>::value || + std::is_convertible<TMaybe<U, Policy>&, T>::value || + std::is_convertible<const TMaybe<U, Policy>&, T>::value || + std::is_convertible<TMaybe<U, Policy>&&, T>::value || + std::is_convertible<const TMaybe<U, Policy>&&, T>::value; + }; template <class U> - struct TAssignableFromMaybeSomehow { - public: - static constexpr bool value = TConstructibleFromMaybeSomehow<U>::value || - std::is_assignable<T&, TMaybe<U, Policy>&>::value || - std::is_assignable<T&, const TMaybe<U, Policy>&>::value || - std::is_assignable<T&, TMaybe<U, Policy>&&>::value || - std::is_assignable<T&, const TMaybe<U, Policy>&&>::value; - }; + struct TAssignableFromMaybeSomehow { + public: + static constexpr bool value = TConstructibleFromMaybeSomehow<U>::value || + std::is_assignable<T&, TMaybe<U, Policy>&>::value || + std::is_assignable<T&, const TMaybe<U, Policy>&>::value || + std::is_assignable<T&, TMaybe<U, Policy>&&>::value || + std::is_assignable<T&, const TMaybe<U, Policy>&&>::value; + }; template <class U> - struct TImplicitCopyCtor { - public: - static constexpr bool value = std::is_constructible<T, const U&>::value && - std::is_convertible<const U&, T>::value && - !TConstructibleFromMaybeSomehow<U>::value; - }; + struct TImplicitCopyCtor { + public: + static constexpr bool value = std::is_constructible<T, const U&>::value && + std::is_convertible<const U&, T>::value && + !TConstructibleFromMaybeSomehow<U>::value; + }; template <class U> - struct TExplicitCopyCtor { - public: - static constexpr bool value = std::is_constructible<T, const U&>::value && - !std::is_convertible<const U&, T>::value && - !TConstructibleFromMaybeSomehow<U>::value; - }; + struct TExplicitCopyCtor { + public: + static constexpr bool value = std::is_constructible<T, const U&>::value && + !std::is_convertible<const U&, T>::value && + !TConstructibleFromMaybeSomehow<U>::value; + }; template <class U> - struct TImplicitMoveCtor { - public: - static constexpr bool value = std::is_constructible<T, U&&>::value && - std::is_convertible<U&&, T>::value && - !TConstructibleFromMaybeSomehow<U>::value; - }; + struct TImplicitMoveCtor { + public: + static constexpr bool value = std::is_constructible<T, U&&>::value && + std::is_convertible<U&&, T>::value && + !TConstructibleFromMaybeSomehow<U>::value; + }; template <class U> - struct TExplicitMoveCtor { - public: - static constexpr bool value = std::is_constructible<T, U&&>::value && - !std::is_convertible<U&&, T>::value && - !TConstructibleFromMaybeSomehow<U>::value; - }; + struct TExplicitMoveCtor { + public: + static constexpr bool value = std::is_constructible<T, U&&>::value && + !std::is_convertible<U&&, T>::value && + !TConstructibleFromMaybeSomehow<U>::value; + }; template <class U> - struct TCopyAssignable { - public: - static constexpr bool value = std::is_constructible<T, const U&>::value && - std::is_assignable<T&, const U&>::value && - !TAssignableFromMaybeSomehow<U>::value; - }; + struct TCopyAssignable { + public: + static constexpr bool value = std::is_constructible<T, const U&>::value && + std::is_assignable<T&, const U&>::value && + !TAssignableFromMaybeSomehow<U>::value; + }; template <class U> - struct TMoveAssignable { - public: + struct TMoveAssignable { + public: static constexpr bool value = std::is_constructible<T, U&&>::value && std::is_assignable<T&, U&&>::value && !TAssignableFromMaybeSomehow<U>::value; - }; + }; - template <class U> - struct TImplicitAnyCtor { - public: - using UDec = std::decay_t<U>; + template <class U> + struct TImplicitAnyCtor { + public: + using UDec = std::decay_t<U>; + + static constexpr bool value = std::is_constructible<T, U>::value && + std::is_convertible<U, T>::value && + !std::is_same<UDec, TInPlace>::value && + !std::is_same<UDec, TMaybe>::value; + }; - static constexpr bool value = std::is_constructible<T, U>::value && - std::is_convertible<U, T>::value && - !std::is_same<UDec, TInPlace>::value && - !std::is_same<UDec, TMaybe>::value; - }; + template <class U> + struct TExplicitAnyCtor { + public: + using UDec = std::decay_t<U>; + static constexpr bool value = std::is_constructible<T, U>::value && + !std::is_convertible<U, T>::value && + !std::is_same<UDec, TInPlace>::value && + !std::is_same<UDec, TMaybe>::value; + }; template <class U> - struct TExplicitAnyCtor { - public: - using UDec = std::decay_t<U>; - static constexpr bool value = std::is_constructible<T, U>::value && - !std::is_convertible<U, T>::value && - !std::is_same<UDec, TInPlace>::value && - !std::is_same<UDec, TMaybe>::value; - }; - - template <class U> - struct TAssignableFromAny { - public: - using UDec = std::decay_t<U>; - static constexpr bool value = !std::is_same<UDec, TMaybe>::value && - std::is_constructible<T, U>::value && - std::is_assignable<T&, U>::value && - (!std::is_scalar<T>::value || !std::is_same<UDec, T>::value); - }; - + struct TAssignableFromAny { + public: + using UDec = std::decay_t<U>; + static constexpr bool value = !std::is_same<UDec, TMaybe>::value && + std::is_constructible<T, U>::value && + std::is_assignable<T&, U>::value && + (!std::is_scalar<T>::value || !std::is_same<UDec, T>::value); + }; + using TBase = TMaybeBase<T>; public: |
