[Phoenix][Range] What's wrong here...

Hi All
Can anyone tell me what's wrong with this? The error message is so huge I'm
a bit overwhelmed!
I suspect type deduction is failing, but none of my efforts to correct it
have worked.
Thx, Rob.
#include

2013/1/17 Robert Jones
Hi All
Can anyone tell me what's wrong with this? The error message is so huge I'm a bit overwhelmed!
I suspect type deduction is failing, but none of my efforts to correct it have worked.
Thx, Rob.
#include
#include #include #include #include #include void f( const double & ) { }
template <class Compare> void sorted( Compare cmp ) { using boost::adaptors::adjacent_filtered; using boost::phoenix::arg_names::_1; using boost::phoenix::arg_names::_2;
std::vector<double> input = { 0.0, 1.0, 2.0, 3.0, 4.0 };
// Ok for_each( input | adjacent_filtered( cmp ) , f );
// Not Ok for_each( input | adjacent_filtered( bind( cmp, _1, _2 ) ) , f ); }
int main( ) { sorted( std::less<double>( ) ); }
Make sure your 'bind' comes from phoenix not std.

On 17/01/13 12:28, Robert Jones wrote:
Hi All
Can anyone tell me what's wrong with this? The error message is so huge I'm a bit overwhelmed!
Learn to read C++ errors. It says /home/mgaunard/dev/boost/trunk/boost/phoenix/core/actor.hpp:174:9: error: ‘typedef boost::proto::exprns_::basic_expr<...>::proto_tag’ is inaccessible /home/mgaunard/dev/boost/trunk/boost/proto/matches.hpp:834:16: error: within this context So it looks like a bug.

On 17/01/13 13:22, Mathias Gaunard wrote:
On 17/01/13 12:28, Robert Jones wrote:
Hi All
Can anyone tell me what's wrong with this? The error message is so huge I'm a bit overwhelmed!
Learn to read C++ errors.
It says /home/mgaunard/dev/boost/trunk/boost/phoenix/core/actor.hpp:174:9: error: ‘typedef boost::proto::exprns_::basic_expr<...>::proto_tag’ is inaccessible /home/mgaunard/dev/boost/trunk/boost/proto/matches.hpp:834:16: error: within this context
So it looks like a bug.
I badly shortened the error message, the problem is with actor< basic_expr<...> >::proto_tag of course. The problem doesn't occur with clang, only gcc, so it's most definitely a bug.

On 01/17/2013 01:33 PM, Mathias Gaunard wrote:
On 17/01/13 13:22, Mathias Gaunard wrote:
On 17/01/13 12:28, Robert Jones wrote:
Hi All
Can anyone tell me what's wrong with this? The error message is so huge I'm a bit overwhelmed!
Learn to read C++ errors.
It says /home/mgaunard/dev/boost/trunk/boost/phoenix/core/actor.hpp:174:9: error: ‘typedef boost::proto::exprns_::basic_expr<...>::proto_tag’ is inaccessible /home/mgaunard/dev/boost/trunk/boost/proto/matches.hpp:834:16: error: within this context
So it looks like a bug.
I badly shortened the error message, the problem is with actor< basic_expr<...> >::proto_tag of course.
The problem doesn't occur with clang, only gcc, so it's most definitely a bug. This is a *very* strange bug. Essentially this says that the typedef is not accessible because it is private. However, the actor template is declared as: template <typename Expr> struct actor { .... };
no private there at all ... even if i add the "public:" explicitly it doesn't solve the problem. This needs further investigation. Thanks for reporting, Thomas
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

On 01/17/2013 04:33 PM, Thomas Heller wrote:
On 01/17/2013 01:33 PM, Mathias Gaunard wrote:
On 17/01/13 13:22, Mathias Gaunard wrote:
On 17/01/13 12:28, Robert Jones wrote:
Hi All
Can anyone tell me what's wrong with this? The error message is so huge I'm a bit overwhelmed!
Learn to read C++ errors.
It says /home/mgaunard/dev/boost/trunk/boost/phoenix/core/actor.hpp:174:9: error: ‘typedef boost::proto::exprns_::basic_expr<...>::proto_tag’ is inaccessible /home/mgaunard/dev/boost/trunk/boost/proto/matches.hpp:834:16: error: within this context
So it looks like a bug.
I badly shortened the error message, the problem is with actor< basic_expr<...> >::proto_tag of course.
The problem doesn't occur with clang, only gcc, so it's most definitely a bug. This is a *very* strange bug. Essentially this says that the typedef is not accessible because it is private. However, the actor template is declared as: template <typename Expr> struct actor { .... };
no private there at all ... even if i add the "public:" explicitly it doesn't solve the problem. This needs further investigation. Looks like a ADL problem. The error essentially comes from this line here: for (; __first != __last; ++__first) ---------------------^^ gcc seems to erronously try to call operator!= from the namespace boost::proto::exprns_. And then, somehow, what should be a SFINAE error turns into a hard error. The quick fix here is to not include
I have no clue yet how to permanently fix this.
Thanks for reporting,
Thomas
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

On 17/01/13 16:57, Thomas Heller wrote:
Looks like a ADL problem. The error essentially comes from this line here: for (; __first != __last; ++__first) ---------------------^^ gcc seems to erronously try to call operator!= from the namespace boost::proto::exprns_. And then, somehow, what should be a SFINAE error turns into a hard error. The quick fix here is to not include
I have no clue yet how to permanently fix this.
Surely the domain grammar should prevent this from happening.

On 17/01/13 13:22, Mathias Gaunard wrote:
On 17/01/13 12:28, Robert Jones wrote:
Hi All
Can anyone tell me what's wrong with this? The error message is so huge I'm a bit overwhelmed!
Learn to read C++ errors.
I tried to find resources explaining how to read C++ errors, unfortunately I couldn't find any. You need to search for "error" in the message, the rest is just the instantiation stack which tells you how the error occurred. Best way to do that is to pipe the standard error output to less.
participants (4)
-
Mathias Gaunard
-
Robert Jones
-
Thomas Heller
-
TONGARI