Quantcast
Channel: Does Rust have an equivalent to C++'s decltype() to get the type of an expression? - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by Shepmaster for Does Rust have an equivalent to C++'s decltype() to...

No, Rust does not have the ability to get the type of an arbitrary expression. typeofis a reserved keyword to potentially allow it in the future:fn main() { let a: i32 = 42; let b: typeof(a) =...

View Article



Does Rust have an equivalent to C++'s decltype() to get the type of an...

My code looks like:macro_rules! mask { ($bitmap: tt, [..$count: tt], for type = $ty: ty) => { { let bit_count = std::mem::size_of::<$ty>() * 8; let dec_bit_count = bit_count - 1; $bitmap &...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images