Yes (a shameful plug :)), I&#x27;ve used macros to generate code for different number of arguments for std::function like lib for pre-C++11 compilers (back in 2009): <a href="https:&#x2F;&#x2F;github.com&#x2F;zura-kh&#x2F;yaf.Function" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;zura-kh&#x2F;yaf.Function</a>