I'm already most of the way there:
#include <boost/preprocessor.hpp>
#define COUNT(...) BOOST_PP_VARIADIC_SIZE(__VA_ARGS__)
COUNT(1,2,3)
COUNT(1,2)
COUNT(1)
COUNT()
Running this with -E
flag in GCC outputs the following
3 2 1 1
When what I need is:
3 2 1 0
What am I doing wrong here? I'm not set on using boost preprocessor
, but I do need the solution to be variadic.
Any ideas how to get this to work?