Tuesday, 17 September 2013

Is there no difference between a function address and the function address' address?

Is there no difference between a function address and the function
address' address?

void f()
{}
void test()
{
auto fn_1 = f;
auto fn_2 = &f;
assert(fn_1 == fn_2); // OK
fn_1(); // OK
fn_2(); // OK
(*fn_1)(); // OK
(*fn_2)(); // OK
}
Are these behaviors explicitly defined by the C++ standard?

No comments:

Post a Comment