You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduction of a SizeOf<T> trait designed to retrieve the size in bits of various data types.
Describe Preferred Solution
traitSizeOf<T>{/// Returns the size in bits of T. fnsize() -> T;/// Returns the size in bits of Self.fnsize_of(self: @T) -> T;}implU8SizeOf of SizeOf<u8>{fnsize() -> u8{8}fnsize_of(self: @u8) -> u8{U8SizeOf::size()}}
After implemented for u8 for example, it would be then:
assert(10_u8.size_of() == 8,'should be 8');// orassert(U8SizeOf::size() == 8,'should be 8');
Feature Request
Describe the Feature Request
Introduction of a
SizeOf<T>
trait designed to retrieve the size in bits of various data types.Describe Preferred Solution
After implemented for
u8
for example, it would be then:Related Code
Implemented in Kakarot::utils::num for PR #410
The usage was:
Additional Context
If the feature request is approved, would you be willing to submit a PR?
The text was updated successfully, but these errors were encountered: