Accessng thread local varialbes from generic functions

⚓ Rust    📅 2025-07-12    👤 surdeus    👁️ 2      

surdeus

I have a case where I need a thread local variable for each of a set of (floating point type, unsigned integer type). Currently, for f64 and u32, I call it THIS_THREAD_TAPE_F64_U32.

I cannot figure out how to write a generic function, e.g. my_fun<F, U>, that can access the tape corresponding to the floating point type F and the unsigned integer type U ?

2 posts - 2 participants

Read full topic

🏷️ rust_feed