mosimu wrote:
I have never fully understood what the difference is between these two forms
of casting. Can anyone please clarify? long is a primitive data type so no,
it's not calling a class constructor. This is not simply a .NET feature
either, also works in VS6.
Besides syntax, there is no difference. There's no difference when ctors are
involved, either. Of course, you can't do things like (char*) x using the
functional notation, and you can't creating temporaries using T() or T(x,y)
with the cast notation. But for single argument ctors, the functional and
cast notations are equivalent.
--
Doug Harrison
Microsoft MVP - Visual C++