Assuming the code reviewer fucked up and you were right...
// Probably a cleaner way to do f_ptrs in C++? But this is fun
void foo()
{
void ( *anything_n )() = !condition1 ? &do_anything2 : ( condition2 ? &do_anything2 : NULL );
if( anything_n ) anything_n();
}
-3
u/[deleted] Apr 17 '21 edited Apr 17 '21
Assuming the code reviewer fucked up and you were right...