Boost logo

Boost Users :

From: Warlich, Christof \(Christof\) (cwarlich_at_[hidden])
Date: 2008-03-13 09:07:23


Hi,

the following code does not compile:

#include <boost/preprocessor/if.hpp>
#include <boost/preprocessor/comma.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <iostream>
class A {};
int main(void) {
    BOOST_PP_IIF(boost::is_convertible<A BOOST_PP_COMMA() A>::value, //
condition
                 std::cout << "ifbranch";, //
then
                 std::cout << "elsebranch";); //
else
    return 0;
}

With gcc, it gives the following errors:

tst.cc:9:30: error: macro "BOOST_PP_IIF_I" passed 4 arguments, but takes
just 3
tst.cc: In function int main():
tst.cc:7: error: BOOST_PP_IIF_I was not declared in this scope

I would have expected that BOOST_PP_COMMA() has just been provided to
deal with cases like this!

I'm just new to Boost, so my apologies if I have overseen something
obvious.

Thanks for any help,

Christof



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