[parameter] Redefining BOOST_PARAMETER_MAX_ARITY

Should I expect to be able to redefine BOOST_PARAMETER_MAX_ARITY and be able to compile? <http://www.boost.org/doc/libs/1_36_0/libs/parameter/doc/html/reference.html#boost-parameter-max-arity> For example using, #define BOOST_PARAMETER_MAX_ARITY 6 #include <boost/parameter/name.hpp> #include <boost/parameter/preprocessor.hpp> // ... code here ... does not compile. Before I spend time digging into the source to figure out the problem I thought I'd post in case the answer was 'no'. Also I wonder if there is some theoretical or practical upper limit? Thanks, Jamie

Jamie Allsop wrote:
Should I expect to be able to redefine BOOST_PARAMETER_MAX_ARITY and be able to compile? <http://www.boost.org/doc/libs/1_36_0/libs/parameter/doc/html/reference.html#boost-parameter-max-arity>
My bad ... this does exactly what it says on the tin. I had included a previous reference to one of the parameter header files and had in fact redefined it... in all the error messages I had missed the obvious. Apologies for the noise. Jamie
For example using,
[ snip ]

on Mon Oct 13 2008, Jamie Allsop <ja11sop-AT-yahoo.co.uk> wrote:
Should I expect to be able to redefine BOOST_PARAMETER_MAX_ARITY and be able to compile? <http://www.boost.org/doc/libs/1_36_0/libs/parameter/doc/html/reference.html#boost-parameter-max-arity>
For example using,
#define BOOST_PARAMETER_MAX_ARITY 6 #include <boost/parameter/name.hpp> #include <boost/parameter/preprocessor.hpp>
// ... code here ...
does not compile.
What is the error? It _should_ work.
Also I wonder if there is some theoretical or practical upper limit?
Surely there is a practical upper limit, but it depends on your compiler and I don't know what it is. -- Dave Abrahams BoostPro Computing http://www.boostpro.com

David Abrahams wrote:
on Mon Oct 13 2008, Jamie Allsop <ja11sop-AT-yahoo.co.uk> wrote:
Should I expect to be able to redefine BOOST_PARAMETER_MAX_ARITY and be able to compile? <http://www.boost.org/doc/libs/1_36_0/libs/parameter/doc/html/reference.html#boost-parameter-max-arity>
For example using,
#define BOOST_PARAMETER_MAX_ARITY 6 #include <boost/parameter/name.hpp> #include <boost/parameter/preprocessor.hpp>
// ... code here ...
does not compile.
What is the error? It _should_ work.
yes it does (see my previous post) apologies for the noise
Also I wonder if there is some theoretical or practical upper limit?
Surely there is a practical upper limit, but it depends on your compiler and I don't know what it is.
gcc 4.2 and as it happens I was using 15 parameters (yes a lot, time pressures et al. caused both my hasty post and lack of simplification). One thing I did not mention was that this is a very cool library. Jamie

on Tue Oct 14 2008, Jamie Allsop <ja11sop-AT-yahoo.co.uk> wrote:
Also I wonder if there is some theoretical or practical upper limit?
Surely there is a practical upper limit, but it depends on your compiler and I don't know what it is.
gcc 4.2 and as it happens I was using 15 parameters (yes a lot, time pressures et al. caused both my hasty post and lack of simplification). One thing I did not mention was that this is a very cool library.
My co-author and I appreciate the positive feedback :-) -- Dave Abrahams BoostPro Computing http://www.boostpro.com

Jamie Allsop <ja11sop <at> yahoo.co.uk> writes:
David Abrahams wrote:
on Mon Oct 13 2008, Jamie Allsop <ja11sop-AT-yahoo.co.uk> wrote:
Should I expect to be able to redefine BOOST_PARAMETER_MAX_ARITY and be able to compile? [snip]
yes it does (see my previous post) apologies for the noise
You mention in another message that this was due to defining it in two headers to different values. The approach I took to deal with this in my usages is to use a central wrapper header for this library and define the value there. I left a comment that this value should only be increased. Don't know that there's a better way.
Also I wonder if there is some theoretical or practical upper limit?
Surely there is a practical upper limit, but it depends on your compiler and I don't know what it is.
gcc 4.2 and as it happens I was using 15 parameters (yes a lot, time pressures et al. caused both my hasty post and lack of simplification).
Just for additional data points, I'm using 14 on msvc 8 sp1 and gcc 4.1.
One thing I did not mention was that this is a very cool library.
Agreed. =) Still trying to convince some co-workers it's okay to use though. ;-)

On Tue, Oct 14, 2008 at 11:05 PM, Ryan Gallagher <ryan.gallagher@gmail.com>wrote:
You mention in another message that this was due to defining it in two headers to different values. The approach I took to deal with this in my usages is to use a central wrapper header for this library and define the value there. I left a comment that this value should only be increased. Don't know that there's a better way.
You can also use the -D option in gcc and msvc to define it that way. -- -Matt Calabrese

Matt Calabrese <rivorus <at> gmail.com> writes:
On Tue, Oct 14, 2008 at 11:05 PM, Ryan Gallagher <ryan.gallagher <at> gmail.com>wrote:
[snip]
Don't know that there's a better way.
You can also use the -D option in gcc and msvc to define it that way.
Doh! Yeah, that'd be the better way. Thanks, -Ryan
participants (4)
-
David Abrahams
-
Jamie Allsop
-
Matt Calabrese
-
Ryan Gallagher