E
exits funnel
Hello,
I was playing around a accidently realized that the following compiles:
//BEGIN CODE
class foo
{
public:
void push(int* iptr) { }
int* peek( )const { }
int* pop( ) { }
};
int main( ) { }
//END CODE
I would expect the compiler to complain because, for example, peek( )
doesn't return an int* or anything else for that matter. If I add
something like 'return 4;' to peek( ) the compiler complains as expected
about the return type mismatch so the empty case seems to be something
special. If anyone could shed some light I'd appreciate it. Thanks in
advance.
-exits
I was playing around a accidently realized that the following compiles:
//BEGIN CODE
class foo
{
public:
void push(int* iptr) { }
int* peek( )const { }
int* pop( ) { }
};
int main( ) { }
//END CODE
I would expect the compiler to complain because, for example, peek( )
doesn't return an int* or anything else for that matter. If I add
something like 'return 4;' to peek( ) the compiler complains as expected
about the return type mismatch so the empty case seems to be something
special. If anyone could shed some light I'd appreciate it. Thanks in
advance.
-exits