Quote:
Originally posted by kasracer
You do realize that proves my point, right? It shows that f() means the samething as f(void).
let me spell it out then. you said:
Quote:
Originally posted by kasracer
Do not pass void to functions in C++.
...
Because the C++ standard says NOT to.
and you were wrong - there's no such interdiction in the C++ standard.
Quote:
Originally posted by kasracer
Besides, when I did a search for 8.3.5.1 I didn't find ANYTHING, but in the standard in 8.3.5 it mentions restricts the use of void as parameter type
My bad - the quote I gave was from Appendix C (C1.6 Clause 8: Declarators). However, you seem to have read 8.3.5 incompletely, since it explicitly says (again) that (void) is equivalent to (). The reason is this is an incompatibility with the C standard where () means no parameter specification. I presume you were referring to the following from 8.3.5.2 (your quote is not verbatim):
Quote:
If the parameter-declaration-clause is empty, the function takes no arguments. The parameter list (void) is equivalent to the empty parameter list. Except for this special case, void shall not be a parameter type (though types derived from void, such as void*, can).
so yes, it's restricted EXCEPT for this case.
Quote:
Originally posted by kasracer
I don't even know why you would top this thread now, it's a bit late.
if you check the thread, nobody had previously corrected the original poster's mistake about confusing iostream objects (in particular cout) with STL objects. second, nobody corrected your assertion about (void) being forbidden. It's only longer to write than (). Some people actually prefer to put it explicitly when they deal with both C and C++ code just to avoid confusions.
Given that the thread was in a 'forum highlights' issue, uncorrected mistakes after such a long time can damaging. Speaking of which, the reccomended use of STLport is overkill. g++ has a complete implementation of STL, no need to download a different one unless there's some obscure implementation incompatibility that one wants to avoid when moving between platforms.