#include <iostream>
#include <cstdint>
void f()
{
    std::cout << "foo\n";
}
int main()
{
   void(*fptr)(void) = f;
   void(**fptrptr)() = &fptr;
   std::uintptr_t addr = reinterpret_cast<std::uintptr_t>(fptrptr);
   addr -= 4;

   (
      (void(*)(void)) // cast to function pointer the following value
      (
        *( // obtain the value pointed to by the following
          (std::uintptr_t*)( // cast to intptr_t pointer
            addr+4 // add 4 to the integer
           )
         )
      )
   )(); // invoke the function pointer
}
