The boost-lambda tag has no wiki summary.
0
votes
0answers
15 views
using boost::lambda to create new object for an existing pointer?
What I want to do is --> create a new object in a new thread.
Something like:
Class* object = 0;
Arg arg;
boost::thread t( lambda::bind( object = lambda::new_ptr< Class >()( boost::ref( arg ) ...
1
vote
2answers
60 views
Setting a member of struct using boost lambda
I am trying to create vector<Wrap> with same values as in v. I tried the below combinations, didn't work!
using namespace std;
struct Wrap
{
int data;
//Other members
};
int main()
{
...
1
vote
3answers
236 views
What functional language approach most readily transfers to Boost Phoenix? [closed]
I am looking to learn functional programming with an am to integrate Boost.phoenix into my project.
What language is most similar so that I can find books that will illustrate functional programming ...
1
vote
0answers
60 views
Use of custom subscript operator with Boost.Lambda
I'm using Visual Studio 2005 and Boost 1.37. I also tested this same code on Visual Studio 2012 Express Desktop and Boost 1.50 without success.
I want to use a Boost.Lambda by accessing a custom ...
0
votes
1answer
56 views
ref() in Boost::Lambda?
What is the equivalent of Boost::Phoenix's ref in Boost::Lambda? I can't find it in the online docs.
#include <algorithm>
#include <string>
#include <boost/lambda/bind.hpp>
using ...
11
votes
3answers
232 views
Does bind() have any advantage (other than compatibility) over C++11 lambdas?
I'm thinking about migrating my code toward using C++11-style lambdas instead of having binds everywhere. But I'm not sure if it's a good idea or not.
Does using e.g. boost::lambda (or ...
1
vote
1answer
96 views
expressing _1.second->pair().first == r in boost::lambda
I've an expression that I need to put in std::transform as callback, but I don't want to write another method for it. I want to express the expression _1.second->pair().first == r to boost::lambda ...
1
vote
1answer
90 views
What is wrong with this boost::lambda::bind usage?
Is there something wrong in this code? I keep getting compilation errors. Basically I want to connect a void returning function to a signal which has a non void return type.
Boost version: Release ...
1
vote
1answer
166 views
How to use boost::is_same in c++ template along with boost::lambda::bind
I'm trying to connect a generic boost::function<void(void)> to many boost::signals2 of varying signature. I'm able to use boot::lambda::bind to do the binding part by passing the return value as ...
3
votes
2answers
197 views
How to use Boost (Lambda?) to make std::sort() easier?
Let's say I have
struct Value { int foo(); };
size_t *begin = ...,
*end = ...;
If I want to sort a bunch of Value indices in C++03, I have to write something tedious like this:
struct ...
0
votes
1answer
102 views
using boost lambda with compound expressions
I have a Visual Studio 2008 C++03 application where I would like to use boost::lambda to perform this action:
enum { fooflag = 0x00000001; }
bool IsFooFlagActive( DWORD flags )
{
return ( flags ...
0
votes
1answer
210 views
boost::lambda std::map
I want to simplify my code by using boost::lambda. Here is my code:
// Declare container:
typedef std::map< PageId, Page* > Pages;
Pages m_pages;
// For serialization:
template < class ...
0
votes
1answer
236 views
MSVC and boost::lambda::bind error: T0: standard-argment not allowed
This code compiles fine with GCC and Clang but not with MSVC 2010:
#include <boost/lambda/lambda.hpp>
#include <boost/lambda/bind.hpp>
#include <boost/function.hpp>
#include ...
0
votes
1answer
108 views
Boost.Lambda - dereference placeholder
Is there a way to dereference a placeholder inside lambda expression ?
boost::function<int(MyClass*)> f = _1->myMethod();
f(myObject);
I know I can make a binding:
...
1
vote
2answers
148 views
problems with C++ boost lambda and ==-operator
There is:
template<typename T>
bool any(::Ref<Iterator<T> > i, boost::function<bool(T)> pred) {
// ...
}
And:
template<typename T> struct Ref {
// ...
};
...