Okay, so really this is two questions:
- How to cast a
*const ()
to a *const c_void
I'm working with glutin
and so I need to cast weird void equivalences...
- What to call
()
when looking it up?
I.E. what is the proper name?
Edit: Sorry for the half-made post, I clicked tab instead of `
*const () as *const c_void
You can cast between any pointer with the same mutability this way, you can also do *const T as *mut T
to change mutability.
1 Like
skysch
3
This is "unit." See here for docs.
2 Likes
kornel
4
When you need this to call a function, the "I don't care just take it" shortcut syntax also works: fun(arg as *const _)
3 Likes