jeudi 10 octobre 2019

How to call a pointer to a function pointer?

Normally, I'd call this function pointer using syntax like the following.

using func_ptr = void (*)();

// ...

(*func_ptr)();

When wrapping a function pointer in a unique_ptr ...

std::unique_ptr<func_ptr> fp;

fp = std::make_unique<func_ptr>((func_ptr) dlsym(handle, "somefunc"));

... how does one call a pointer to a function pointer? I tried ...

(**fp)();

to no avail.

Aucun commentaire:

Enregistrer un commentaire