How to cast *const () to *const c_void

Okay, so really this is two questions:

  1. How to cast a *const () to a *const c_void
    I’m working with glutin and so I need to cast weird void equivalences…
  2. 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

This is “unit.” See here for docs.


When you need this to call a function, the “I don’t care just take it” shortcut syntax also works: fun(arg as *const _)