Hey, its me again..
PHP Code:
type foobar()
{
return (type)1337;
}
class myClass
{
public:
type x;
type foobar( float value )
{
type t = value * 2;
std::cout << "type foobar( float value )" << std::endl;
return t;
}
void foobar( float value )
{
x = value;
std::cout << "void foobar( float value )" << std::endl;
}
};
float tmp;
myClass c1 , c2;
foobar(); //calls function but returnvalue isnt used
tmp = c1.foobar( 42 );//calls methods
c2.foobar( 42 ); //does the compiler use the method without a returnvalue?
i know that the compiler generates different function-identifiers for both methods (different in and output types)
but my question is: does the compiler/cpu know when to use a method with or without the returnvalue?
EDIT
maybe these console prints will brigthen things up