Skip to content

proposal for helper functions when dealing with overloaded methods #104

@rherilier

Description

@rherilier

After having read #79, I started writing explicitly the types when calling signal::connect(...). But as I have some long type names, I looked for an other solution.

I remembered that Qt defines some helper (see qoverload.h), but the parameters list have still to be written...

So, I finally write some functions to enforce their detection, like this one:

template<typename T_return, typename T_obj, typename T_obj2, typename... T_arg>
inline decltype(auto)
connect(sigc::signal<T_return(T_arg...)>& signal, T_obj& obj, T_return (T_obj2::*fun)(T_arg...))
{
    return signal.connect(sigc::mem_fun<T_return, T_obj, T_obj2, T_arg...>(obj, fun));
}

Any feedback/comment are welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions