aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/store_policy.h
diff options
context:
space:
mode:
authorAlexander Fokin <apfokin@gmail.com>2022-02-10 16:45:38 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:38 +0300
commit863a59a65247c24db7cb06789bc5cf79d04da32f (patch)
tree139dc000c8cd4a40f5659e421b7c75135d080307 /util/generic/store_policy.h
parentf64e95a9eb9ab03240599eb9581c5a9102426a96 (diff)
downloadydb-863a59a65247c24db7cb06789bc5cf79d04da32f.tar.gz
Restoring authorship annotation for Alexander Fokin <apfokin@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'util/generic/store_policy.h')
-rw-r--r--util/generic/store_policy.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/util/generic/store_policy.h b/util/generic/store_policy.h
index 148821c70c..d8a4b530ae 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))
{
}
};