2 ms·
- malloc() returns void* because it allocates memory, not objects. If you want your objects initialized, use 'new'. - I was under the impression that a round-t
by tbrownaw 17y ago
- malloc() returns void* because it allocates memory, not objects. If you want your objects initialized, use 'new'.
- I was under the impression that a round-trip through void* always worked? Or do you mean that "Derived d;Base * b = (Base* )(void* )&d;" doesn't work (which I wouldn't consider "broken")?
- I like knowing that something won't be null. Also, your "bitwise and" operator was already an overloaded mess.
- You only need the #ifdefs if you still have to interface with legacy C code that has variables named "class" or other such foolishness that makes it not compilable as C++. :)