diff options
author | Ruslan Kovalev <ruslan.a.kovalev@gmail.com> | 2022-02-10 16:46:44 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:44 +0300 |
commit | 59e19371de37995fcb36beb16cd6ec030af960bc (patch) | |
tree | fa68e36093ebff8b805462e9e6d331fe9d348214 /library/cpp/deprecated/accessors/accessors.h | |
parent | 89db6fe2fe2c32d2a832ddfeb04e8d078e301084 (diff) | |
download | ydb-59e19371de37995fcb36beb16cd6ec030af960bc.tar.gz |
Restoring authorship annotation for Ruslan Kovalev <ruslan.a.kovalev@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/deprecated/accessors/accessors.h')
-rw-r--r-- | library/cpp/deprecated/accessors/accessors.h | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/library/cpp/deprecated/accessors/accessors.h b/library/cpp/deprecated/accessors/accessors.h index 6d4b1da3ad..3ecdc2aab5 100644 --- a/library/cpp/deprecated/accessors/accessors.h +++ b/library/cpp/deprecated/accessors/accessors.h @@ -1,38 +1,38 @@ -#pragma once - -#include "accessors_impl.h" - -namespace NAccessors { +#pragma once + +#include "accessors_impl.h" + +namespace NAccessors { /* - * Adds API compatibility between different types representing memory regions. - * - * i.e. this will work: - * + * Adds API compatibility between different types representing memory regions. + * + * i.e. this will work: + * * TString t; - * const char* beg = NAccessors::Begin(t); // t.begin() - * const char* end = NAccessors::End(t); // t.end() - * size_t sz = NAccessors::Size(t); // t.size() - * - * as well as this: - * - * ui64 t; - * const ui64* beg = NAccessors::Begin(t); // &t - * const ui64* end = NAccessors::End(t); // &t + 1 - * size_t sz = NAccessors::Size(t); // 1 - * - * Both will give you begin, end and size of the underlying memory region. - */ - + * const char* beg = NAccessors::Begin(t); // t.begin() + * const char* end = NAccessors::End(t); // t.end() + * size_t sz = NAccessors::Size(t); // t.size() + * + * as well as this: + * + * ui64 t; + * const ui64* beg = NAccessors::Begin(t); // &t + * const ui64* end = NAccessors::End(t); // &t + 1 + * size_t sz = NAccessors::Size(t); // 1 + * + * Both will give you begin, end and size of the underlying memory region. + */ + template <typename T> inline const typename TMemoryTraits<T>::TElementType* Begin(const T& t) { return NPrivate::TBegin<T>::Get(t); } - + template <typename T> inline const typename TMemoryTraits<T>::TElementType* End(const T& t) { return NPrivate::TEnd<T>::Get(t); } - + template <typename T> inline size_t Size(const T& t) { return End(t) - Begin(t); @@ -80,4 +80,4 @@ namespace NAccessors { const typename TMemoryTraits<T>::TElementType* end) { NPrivate::TAssign<T>::Do(t, beg, end); } -} +} |