1[/ 2 (C) Copyright Edward Diener 2011-2015 3 Distributed under the Boost Software License, Version 1.0. 4 (See accompanying file LICENSE_1_0.txt or copy at 5 http://www.boost.org/LICENSE_1_0.txt). 6] 7 8[section:vmd_vmacros Using variadic macros] 9 10Variadic macros, as specified by C++11, is a feature taken from the C99 11specification. They are macros which take a final parameter denoted as 12'...' which represents one or more final arguments to the macro as a 13series of comma-separated tokens. In the macro expansion a special 14keyword of `__VA_ARGS__` represents the comma-separated tokens. This 15information when passed to a variadic macro I call 'variadic macro data', 16which gives its name to this library. The more general term 'variadic data' 17is used in this documentation to specify data passed to a macro which can 18contain any number of macro tokens as a single macro parameter, such as is 19found in Boost PP data types. 20 21[heading Boost support] 22 23The Boost PP library has support for variadic macros and uses its 24own criteria to determine if a particular compiler has that support. 25Boost PP defines or uses the macro BOOST_PP_VARIADICS to denote whether 26the compiler being used supports variadic macros. When BOOST_PP_VARIADICS 27is set to 1 the compiler supports variadic macros, otherwise when 28BOOST_PP_VARIADICS is set to 0 the compiler does not support variadic macros. 29If a user of Boost PP sets this value, Boost PP uses the value the end-user 30sets, otherwise Boost PP defines the value of BOOST_PP_VARIADICS based on its 31own analysis of the compiler being used. This macro can also be checked to 32determine if a compiler has support for variadic macros. 33 34[heading Determining variadic macro support] 35 36The VMD library automatically determines whether variadic macro support 37is enabled for a particular compiler by also using the same BOOST_PP_VARIADICS 38macro from Boost PP. The end-user of VMD can also manually 39set the macro BOOST_PP_VARIADICS to turn on or off compiler support for 40variadic macros in the VMD library. When BOOST_PP_VARIADICS is set to 0 41variadic macros are not supported in the VMD library, otherwise when 42BOOST_PP_VARIADICS is set to non-zero they are supported in the VMD library. 43This same macro can be used to determine if VMD supports variadic macros for a 44particular compiler. 45 46Since this library completely depends on variadic macro support, if BOOST_PP_VARIADICS 47is set to 0, using any of the macros in VMD will lead to a compiler error 48since the macro will not be defined. However just including any of the header 49files in VMD, even with no variadic macro support for the compiler, will not 50lead to any compiler errors. 51 52[endsect]