Boost logo

Boost Users :

Subject: Re: [Boost-users] Preprocessor Question
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2009-11-16 13:00:54


> Hartmut Kaiser wrote:
> >> Thanks for the solution,
> >>
> >> but it was actually failing in getting number of arguments to the
> >> macro.
> >>
> >> warning C4003: not enough actual parameters for macro 'PP_ARG_N'
> >>
> >> so PP_NARG evaluates to nothing and subsequently everything fails.
> >>
> >
> > Please note that the VC preprocessor does not support variadic
> macros, which makes the valid implementation of PP_NARG() fail.
> >
>
> I can compile
>
> void f(int, int) {}
>
> #define test(...) __VA_ARGS__
> int main() {
> f(test(57, 21));
> }
>
> with msvc 9.0.

I stand corrected! Thanks for the info.

Regards Hartmut

-------------------
Meet me at BoostCon
http://boostcon.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