Quote:
Originally posted by KnifeMissle
Functions are already pointers so, like arrays, you don't need to dereference them when assigning to pointers. In fact, I'm surprised that compilers are hacked to work despite the dereferencing!
The for() loop was just for style, as is the num_of() template function. Although far more complicated than the macro, it's safer 'cause the marcro will erroneously compile if you use a pointer instead of an array. The function only makes sense if you're passing in an array of objects...
The double spacing is annoying. I would have used the quote block except it removes all leading white space. By the way, n0nsensical, how on Earth did you enter tabs into the text box? Thanks!
|
I don't know if it's in the C++ Standard but as far as I know the & before function names is simply optional, not illegal. Same for using the * operator to call a function through a pointer. I just copied and pasted in the code and the tabs went with it.