Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get pointer to target #28

Open
optimizedaway opened this issue Sep 12, 2019 · 1 comment
Open

Get pointer to target #28

optimizedaway opened this issue Sep 12, 2019 · 1 comment

Comments

@optimizedaway
Copy link

optimizedaway commented Sep 12, 2019

@Naios

Great improvement over std::function, but there is no std::function::target counterpart. I use it for logging addresses of underlying callable objects, very useful for debugging:

...
catch (const std::exception &e)
{
    LOG_ERROR("Async function 0x%p raised exception: %s", f.target<void(*)(void)>(), e.what());
}

Any chance of implementing such feature?

@Naios
Copy link
Owner

Naios commented Sep 12, 2019

Good suggestion, maybe this will be added in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants