The BOOST_PP_VARIADIC_SIZE variadic macro expands to the size of the variadic data passed to it.

Usage

BOOST_PP_VARIADIC_SIZE(...) (v)

Arguments

...
  Variadic data whose size is to be extracted.

Requirements

Header:  <boost/preprocessor/variadic/size.hpp>

Sample Code

#include <boost/preprocessor/variadic/size.hpp>

#define VAR_DATA x, y, z

BOOST_PP_VARIADIC_SIZE(VAR_DATA) // expands to 3

© Copyright Edward Diener 2011,2013

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt)