1

Imagine I've got sth. like this:

template<typename Signature>
struct Callable
{
    template<typename FnType>
        requires std::convertible_to<std::invoke_result_t<FnType>, std::invoke_result_t<Signature>> && ***
    Callable( FnType fn );
    template<typename ... Args>
        requires ***
    std::invoke_result_t<Signature> operator ()( Args &&... args );
};

Signature is a function-type, i.e. f.e. <int( int, string )>. How do I complete the above ***'ed concepts so that I check that either that FnType has an calling operator whose parameters match the parameters of Signature or that the args match the parameters of Signature ?

Bonita Montero
  • 2,817
  • 9
  • 22
  • 1
    Check out the answer: https://stackoverflow.com/questions/28509273/get-types-of-c-function-parameters/70954691#70954691 Once you know the types of arguments you can do **`is_same_v::type, typename FnType::type>;`** – Const Apr 07 '22 at 05:42

0 Answers0