diff options
author | Alexander Fokin <apfokin@gmail.com> | 2022-02-10 16:45:38 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:38 +0300 |
commit | bf9e69a933f89af083d895185f01ed65e4d90766 (patch) | |
tree | b2cc84ee7850122e7ccf51d0ea21e4fa7e7a5685 /util/generic/store_policy.h | |
parent | 863a59a65247c24db7cb06789bc5cf79d04da32f (diff) | |
download | ydb-bf9e69a933f89af083d895185f01ed65e4d90766.tar.gz |
Restoring authorship annotation for Alexander Fokin <apfokin@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'util/generic/store_policy.h')
-rw-r--r-- | util/generic/store_policy.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/util/generic/store_policy.h b/util/generic/store_policy.h index d8a4b530ae..148821c70c 100644 --- a/util/generic/store_policy.h +++ b/util/generic/store_policy.h @@ -71,10 +71,10 @@ struct TRefPolicy { }; /** - * Storage class that can be handy for implementing proxies / adaptors that can - * accept both lvalues and rvalues. In the latter case it's often required to - * extend the lifetime of the passed rvalue, and the only option is to store it - * in your proxy / adaptor. + * Storage class that can be handy for implementing proxies / adaptors that can + * accept both lvalues and rvalues. In the latter case it's often required to + * extend the lifetime of the passed rvalue, and the only option is to store it + * in your proxy / adaptor. * * Example usage: * \code @@ -87,28 +87,28 @@ struct TRefPolicy { * template<class T> * TProxy<T> MakeProxy(T&& value) { * // Rvalues are automagically moved-from, and stored inside the proxy. - * return {std::forward<T>(value)}; + * return {std::forward<T>(value)}; * } * \endcode * * Look at `Reversed` in `adaptor.h` for real example. */ -template <class T, bool IsReference = std::is_reference<T>::value> +template <class T, bool IsReference = std::is_reference<T>::value> struct TAutoEmbedOrPtrPolicy: TPtrPolicy<std::remove_reference_t<T>> { - using TBase = TPtrPolicy<std::remove_reference_t<T>>; + using TBase = TPtrPolicy<std::remove_reference_t<T>>; - TAutoEmbedOrPtrPolicy(T& reference) - : TBase(&reference) + TAutoEmbedOrPtrPolicy(T& reference) + : TBase(&reference) { } }; -template <class T> +template <class T> struct TAutoEmbedOrPtrPolicy<T, false>: TEmbedPolicy<T> { - using TBase = TEmbedPolicy<T>; + using TBase = TEmbedPolicy<T>; - TAutoEmbedOrPtrPolicy(T&& object) - : TBase(std::move(object)) + TAutoEmbedOrPtrPolicy(T&& object) + : TBase(std::move(object)) { } }; |