×

Loading...

A few more words about this question

本文发表在 rolia.net 枫下论坛There are two kinds of functions in C++: global ones and those in the class( let's forget about struct).

I don't know the answer for the global functions. But for (non-static) class functions, I think the answer is "this" pointer. Just remind how the C++ compiler works: The programmer do not put "this" as an argument, but
the C++ compiler will include it as it "decorates" the function signature.
I also don't know the answer for the static function in a class.

Well, I know some friends consider the following cases:

1) void f() {}
This fuction does not contain an explicit argument. But it is equivalent to having "void" as an argument.

2) void f(int a=0; double d=0.0){}
Here a=0 and d=0.0 are default value. It seems I have not yet heard there are named "implicit argument".

I have checked some C++ books's index and I failed finding entries about "implicit arguments". I also consulted with two C++ gurus among my friends and they said they have no good ideas.

If anybody know the complete answer, please tell us and give us some
references.

Thanks a lot.更多精彩文章及讨论,请光临枫下论坛 rolia.net
Sign in and Reply Report

Replies, comments and Discussions: