Skip to content

Get pointer to target #28

Open
Open
@optimizedaway

Description

@optimizedaway

@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?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions