#include <type_traits>
#include <iostream>

int foo(int a, int b)
{
     return 1;
}

//int foo(int a, int b, bool c)
//{
//    return 0;
//}

template <typename R, typename ... Types>
constexpr size_t getArgumentCount(R(*)(Types ...))
{
    return sizeof...(Types);
}

template <bool ... bools>
    static int fooImpl(int a, int b) {
    	return foo(a, b, bools...);
}

template<int N>
static int setupTempl(int a, int b, typename std::enable_if<N == 3, void>::type* = nullptr)
{
     return fooImpl<true>(a, b);
}

template<int N>
static int setupTempl(int a, int b, typename std::enable_if<N == 2, void>::type* = nullptr)
{
     return fooImpl<>(a, b); // fooImpl(a, b)
}

int main()
{
     setupTempl<getArgumentCount(foo)>(1, 2);
     
     return 0;
}
