Re: Preprocessor directive for a sequence that differs only in datatype

Gavin Lambert via Boost <[email protected]>
Newsgroups gmane.comp.lib.boost.devel,gmane.comp.lib.boost.ublas
Message-ID <[email protected]>
On 11/07/2017 19:22, Rishabh Arora wrote:
> I was trying to use the boost.preprocessor to write some code which 
> otherwise needs to be written for all the cases.
> Here's the code: 
> https://github.com/BoostGSoC17/dataframe/blob/master/include/df.cpp 
> (line no. 430 and 431).
> But on compilation it gives the error:
> error: macro "BOOST_PP_SEQ_ELEM_III" requires 2 arguments, but only 1 given
>       print_column <BOOST_PP_SEQ_ELEM(type, INNER_TYPE) >(i);
> 
> I didn't understand the reason as when I wrote: print_column 
> <BOOST_PP_SEQ_ELEM(any_numerical_value(0, 1, ...), INNER_TYPE) >(i); it 
> works fine.
> Can anyone help me understand the error or provide an alternative way to 
> do the same thing?

BOOST_PP_SEQ_ELEM's first parameter must be an expression resolvable at 
preprocessing time (usually a constant).

"type" doesn't exist until runtime.


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.