'How to make a templated parameter to match the function-signature of an outer templated type
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 ?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|