



A subset of identifiers is VMD types, called a 'v-type'. These are identifiers which represent all of the preprocessor data types which VMD can parse. This subset of identifiers is automatically registered and pre-detected by VMD. Each identifier type begins with the unique prefix 'BOOST_VMD_TYPE_'.

The actual types are:

Since a v-type is itself an identifier the particular constraint on the input to test is exactly the same as for identifiers.




The macro used to test for a particular type in VMD is called BOOST_VMD_IS_TYPE. The macro takes a single parameter, the input to test against.

The macro returns 1 if the parameter is a v-type, otherwise the macro returns 0.

A v-type is also an identifier, which has been registered and pre-detected, so you can also use the VMD functionality which works with identifiers to work with a v-type as an identifier if you like.


Let us look at an example of how to use BOOST_VMD_IS_TYPE.

#include <boost/vmd/is_type.hpp>



if input = BOOST_VMD_TYPE_SEQ, 1
if input = SQUARE, 0
if input = BOOST_VMD_TYPE_IDENTIFIER DATA, 0 since there are tokens after the type
if input = ( BOOST_VMD_TYPE_EMPTY ), 0 since the macro begins with a tuple and this can be tested for

To use the BOOST_VMD_IS_TYPE macro either include the general header:

#include <boost/vmd/vmd.hpp>

or include the specific header:

#include <boost/vmd/is_type.hpp>