diff options
| author | Arseny Smirnov <arseny30@gmail.com> | 2018-03-26 17:05:41 +0300 |
|---|---|---|
| committer | Arseny Smirnov <arseny30@gmail.com> | 2018-03-26 17:05:41 +0300 |
| commit | 4f01ee03f700a4fd80f3d2eff640a5a5fecdef2a (patch) | |
| tree | 6264ef88f1a45fea34dca15f7903907bb91d0787 /tdutils/td/utils/Slice.h | |
| parent | 597db4b4ce7fdf489cd4a67925fe0e4be6ddc454 (diff) | |
Slice as_slice(const UInt<N> &)
GitOrigin-RevId: f934016e24074f6d57dfe4bb95f649f2e5a18eed
Diffstat (limited to 'tdutils/td/utils/Slice.h')
| -rw-r--r-- | tdutils/td/utils/Slice.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tdutils/td/utils/Slice.h b/tdutils/td/utils/Slice.h index a9bc6a755..790e057e5 100644 --- a/tdutils/td/utils/Slice.h +++ b/tdutils/td/utils/Slice.h @@ -272,4 +272,13 @@ inline std::size_t SliceHash::operator()(Slice slice) const { return result; } +template <size_t N> +td::Slice as_slice(const td::UInt<N> &value) { + return td::Slice(value.raw, N / 8); +} +template <size_t N> +td::MutableSlice as_slice(td::UInt<N> &value) { + return td::MutableSlice(value.raw, N / 8); +} + } // namespace td |
