Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2007-10-02 20:32:03


on Tue Oct 02 2007, Josh Brown <jbrown-AT-arlut.utexas.edu> wrote:

> I'm using the preprocessor lib to generate a class definition from a
> sequence of sequences. I want to be able to make the last element of
> each sequence optional and generate additional code based on if the last
> parameter exists. I'm currently testing for the length of the sequence
> in a BOOST_PP_IF statement to see if it has the optional last
> parameter. The problem is that both the true and false result
> expressions are being expanded and then the correct one is selected

The simplest way to deal with that problem might be to have the IF
macro select one of two function-like macro *names*, and then invoke
the one that's selected.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net