Re: Shared memory and C++
It means that most of the time, casting is not needed in C++. The typing rules should handle most of the type coercions automatically, or the coercions should coded in a few places. If you find yourself needing a cast, perhaps something is wrong with the code.
Also if an arbitrary area of memory is declared as void *, this is automatically compatible with any typed pointer, and you don't need a cast. (Provided alignment constraints are adhered to.) malloc() returns a void * that is compatible with all typed pointers. Of course, you really should be using new() instead of malloc().
|