There are some C++11 solutions for finding the number of arguments at compile-time, but I'm surprised to see that no one has suggested anything so simple as:
#define VA_COUNT(...) detail::va_count(__VA_ARGS__)
namespace detail
{
template<typename ...Args>
constexpr std::size_t va_count(Args&&...) { return sizeof...(Args); }
}
This doesn't require inclusion of the <tuple>
header either.