Boost logo

Boost Users :

Subject: [Boost-users] [preprocessor] error: macro "BOOST_PP_SEQ_ELEM_III"
From: Reimund Klemm (klemm_at_[hidden])
Date: 2009-03-12 03:51:16

I'm having a problem with the preprocessor and currently I'm stuck. I
tried to reduce the problem from my program as far as possible.

Why does this example compile with an error?:

#include <boost/preprocessor/seq/subseq.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/control/if.hpp>

#define SEQ (b)(o)(o)(s)(t)
#define i 0

int main( int argc, char* argv[]){
  return 0;

The error is the following:

./test.cxx:23:1: error: macro "BOOST_PP_SEQ_ELEM_III" requires 2
arguments, but only 1 given

I'm using gcc 4.3.1 under Linux.

As the condition is 0, the preprocessor shouldn't expand
The preprocessed file (g++ -P -E) has expands to 0; but the preprocessor
still throws an error.

Could also someone give me a hint how to debug efficiently such a
problem, as I'm a newbie to boost.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at