[Boost-bugs] [ boost-Bugs-1602075 ] Lambda: (_1 + "y")(string("x")) Doesn't Compile

Bugs item #1602075, was opened at 2006-11-23 19:14 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1602075&group_id=7586 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Lambda: (_1 + "y")(string("x")) Doesn't Compile Initial Comment: This program: #include <iostream> #include <ostream> #include <string> #include <boost/lambda/lambda.hpp> int main() { const std::string s("Hello"); std::cout << (boost::lambda::_1 + ", world!")(s) << std::endl; } fails to compile with Boost 1.33.1 (on GCC 3.4.2 and GCC 4.1.1, at least) due to at least two bugs. One bug is in boost/lambda/detail/operators.hpp, lines 269-271. This function, declared to return a lambda_functor, returns a lambda_functor constructed from a tuple. But there is no such constructor. Instead, 'lambda_functor<' should be deleted from line 269 (and the closing '>' from line 271) so that it returns a lambda_functor_base constructed from a tuple. That constructor (which is explicit) does exist, and so does a lambda_functor constructor (which is implicit) from a lambda_functor_base. This is exactly what the macro BOOST_LAMBDA_PTR_ARITHMETIC_E2 immediately below does, and there is no reason for BOOST_LAMBDA_PTR_ARITHMETIC_E1 to be different. Unfortunately, fixing that leaves another, more complicated bug: for some reason, the return type appears to be deduced as const char * instead of std::string. See for yourself. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1602075&group_id=7586 ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Boost-bugs mailing list Boost-bugs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/boost-bugs
participants (1)
-
SourceForge.net