|
Boost : |
Subject: Re: [boost] [fusion] make_fused arity > 10
From: Larry Evans (cppljevans_at_[hidden])
Date: 2011-07-20 12:55:09
On 07/20/11 10:22, Mario Mulansky wrote:
> Hi
>
> We are using Boost.Fusion quite heavily in our library [odeint] and
> I just came across some problem that took me several hours to solve
> so I decided to let you know about the issue.
> We use boost::fusion::make_fused to make functor applicable to
> fusion sequences and as we occasionally deal with long vectors we
> increased the limits as described here:
[snip]
> At first we used 10 as maximum (also changing FUSION_MAX_VECTOR_SIZE
> and the ..INVOKE.. constants, of course). However, today I extended
> the library and had to increase these values to 16. Unfortunately,
> that did not work - compiling still failed at functors with arity
> 11. So I digged into Boost.Fusion and after quite some time I
> realized that it relies on boost::result_of which has an upper limit
> of 10. So additionally changing BOOST_RESULT_OF_NUM_ARGS to 16 made
> everything work, eventually.
> I think the point here is that defining
> BOOST_FUSION_UNFUSED_MAX_ARITY > 10 without also defining
> BOOST_RESULT_OF_NUM_ARGS accordingly will break the code in a rather
> confusing way - I think at least adding a note in the docs could be
> very helpful here.
Christopher Schmidt's conversion of fusion to variadic templates:
http://article.gmane.org/gmane.comp.lib.boost.devel/194504
might be some help. I say "might" because it requires using g++ or
possibly clang to compile variadic template code and maybe your boss
or company won't allow that for some reason.
I *think* maybe variadic fusion is here:
http://svn.boost.org/svn/boost/sandbox/SOC/2009/fusion/boost/fusion/
but I'd check with Christopher to make sure.
-regards,
Larry
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk