|
Boost : |
Subject: Re: [boost] [preprocessor]BOOST_PP_CHECK_2 with wrong number args
From: Edward Diener (eldiener_at_[hidden])
Date: 2011-08-24 18:20:09
On 8/24/2011 5:57 PM, Larry Evans wrote:
> On 08/24/11 16:34, Edward Diener wrote:
> [snip]
>>> This results in the errors reported here:
>>>
>>> http://article.gmane.org/gmane.comp.lib.boost.devel/222795
>>>
>>> when that line is changed to:
>>>
>>> # define BOOST_PP_CHECK_1(chk) BOOST_PP_CHECK_2(chk,_)
>>>
>>> the reported error goes away; however, several other errors
>>> occur about too many instead of too few arguments passed to
>>> BOOST_PP_CHECK_2.
>>>
>>> Is this a BOOST_PP bug? If not; how can the errors reported
>>> in:
>>>
>>> http://article.gmane.org/gmane.comp.lib.boost.devel/222795
>>>
>>> be avoided?
>>
>> I believe it is allowable because of placeholder expressions, but this
>> may have been because of C99, whereas a preprocessor that does not
>> support C99 may not work.
>>
>> BTW, nothing has changed with BOOST_PP_CHECK with Boost 1.47, as the
>> code has appeared the way it is for a long time.
>>
>> What compiler are you using ? Is there a C99 or a C++0x mode you can
>> turn on in the command line somehow ?
>
> Here's the compile command and part of output:
>
> /home/evansl/download/gcc/4.6.0-release/install/bin/g++ -c -Wall
> -ftemplate-depth-300 -O0 -fpermissive -I.
> -I/home/evansl/prog_dev/boost-svn/ro/boost_1_47_0 curryable.cpp
> In file included from
> /home/evansl/prog_dev/boost-svn/ro/boost_1_47_0/boost/preprocessor/iteration/detail/iter/forward2.hpp:50:0,
> from ./curryable.hpp:157,
> from
> /home/evansl/prog_dev/boost-svn/ro/boost_1_47_0/boost/preprocessor/iteration/detail/iter/forward1.hpp:47,
> from curryable.hpp:113,
> from curryable.cpp:1:
> ./curryable.hpp:117:1: error: macro "BOOST_PP_CHECK_2" requires 2
> arguments, but only 1 given
> ./curryable.hpp:117:1: error: macro "BOOST_PP_CHECK_2" requires 2
> arguments, but only 1 given
>
>
>
> I don't see anything on the above command line that indicates
> a c99 or c++0x mode, except maybe the -fpermissive.
>
> Thanks for the help.
I have Eric Niebler's curryable.h. Is that your header file renamed to
curryable.hpp ? What doe curryable.cpp look like ?
If I can know the exact curryable.hpp and curryable.cpp you are using I
can try it out with gcc-4.6.0 using MingW under Windows and see what my
results are.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk