lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> This HAS to be a reinterpret_cast because all casts through void* are
> considered unsafe by the compiler.

Sorry, but this is wrong.
A compiler will generate error when using static_cast to convert
between *unrelated* pointer types.
The generic void* pointer is considered related with all T* pointers
(without const or volatile qualifier).
Also, the cast from A* to B* is accepted by static_cast if B derives
from A (the other way round, converting B* to A* does not need any
cast of course).