Opened 10 years ago
Closed 6 years ago
#7165 closed Bugs (fixed)
cannot change BOOST_PHOENIX_LIMIT
Reported by: | Owned by: | Thomas Heller | |
---|---|---|---|
Milestone: | To Be Determined | Component: | phoenix |
Version: | Boost 1.50.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Hi !
The following code :
#define BOOST_PHOENIX_LIMIT 20 #include <boost/phoenix.hpp>
fails to compile with boost 1.50 and msvc 2010 with an error trace starting with :
1>C:\dev\include\boost/phoenix/core/preprocessed/actor_30.hpp(10): error C2977: 'boost::proto::and_' : too many template arguments 1> C:\dev\include\boost/proto/matches.hpp(784) : see declaration of 'boost::proto::and_'
The following compiles :
#define BOOST_PHOENIX_LIMIT 20 #define BOOST_PROTO_MAX_LOGICAL_ARITY 20 #include <boost/phoenix.hpp>
In http://boost.2283326.n4.nabble.com/phoenix-not-playing-nice-with-other-libs-td3489758.html Eric Niebler seems to suggest that proto::and_ should be split and nested to avoid having to change BOOST_PROTO_MAX_LOGICAL_ARITY, wouldn't that solve the issue ?
Thanks, MAT.
Attachments (1)
Change History (6)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
A bit of follow-up,
The following code fails :
#define BOOST_PHOENIX_LIMIT 20 #define BOOST_PROTO_MAX_LOGICAL_ARITY BOOST_PHOENIX_LIMIT #include <boost/phoenix/core/argument.hpp> void f() { boost::phoenix::arg_names::arg11; }
with :
error C2039: 'arg11' : is not a member of 'boost::phoenix::arg_names'
Adding this to the top :
#define BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES
yields :
...phoenix/core/environment.hpp(412): warning C4005: 'BOOST_PHOENIX_M0' : macro redefinition ...phoenix/support/detail/iterate_define.hpp(108) : see previous definition of 'BOOST_PHOENIX_M0'
I hope this helps, tell me if there is anything I can do to help fix all this.
Thanks !
MAT.
by , 9 years ago
Attachment: | boost_phoenix_7165.patch added |
---|
comment:3 by , 9 years ago
I finally managed to write a test case and a fix for this, see boost_phoenix_7165.patch
The patch initially contained the regenerated preprocessed actor.hpp files but the server refused to upload it because it's over the size limit (it's 566 KB !). I still have it and can email it directly to you if you want.
The idea of the fix is to replace
boost::proto::and_< something, something, something, ... >
with
boost::proto::and_< something, boost::proto::and_< something, boost::proto::and_< something, ... > > >
Cheers, MAT.
comment:5 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
It looks like a fix for this issue would be in limits.hpp to change :
into :