From 4f01ee03f700a4fd80f3d2eff640a5a5fecdef2a Mon Sep 17 00:00:00 2001 From: Arseny Smirnov Date: Mon, 26 Mar 2018 17:05:41 +0300 Subject: [PATCH] Slice as_slice(const UInt &) GitOrigin-RevId: f934016e24074f6d57dfe4bb95f649f2e5a18eed --- tdutils/td/utils/Slice.h | 9 +++++++++ 1 file changed, 9 insertions(+) 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 +td::Slice as_slice(const td::UInt &value) { + return td::Slice(value.raw, N / 8); +} +template +td::MutableSlice as_slice(td::UInt &value) { + return td::MutableSlice(value.raw, N / 8); +} + } // namespace td