boost-bind Questions
3
Solved
The following code causes cl.exe to crash (MS VS2005).
I am trying to use boost bind to create a function to a calls a method of myclass:
#include "stdafx.h"
#include <boost/function.hpp>
#...
Harrow asked 20/2, 2010 at 23:37
3
Is there a way to partially bind the first/last n arguments of a callable object (e.g. function) without explicitly specifying the rest of the arguments?
std::bind() seems to require that all the...
Zerk asked 19/1, 2014 at 12:29
5
Solved
could someone summarize in a few succinct words how the boost shared_from_this<>() smart pointer should be used, particularly from the perspective of registering handlers in the io_service us...
Blum asked 2/9, 2010 at 17:23
2
Solved
Has anyone ever combined the classic generic factory by Andrei Alexandrescu (page 208 of Chapter 8 in Modern C++ Design) with the 'multifunction' capabilities of Boost.TypeErasure? That is, the fle...
Etalon asked 16/2, 2018 at 4:0
1
Solved
I'm trying to do something very similar to this but I'm struggling to pass the string to/from the callback.
This is a pared down version of the code I'm trying to run:
using namespace System;
usi...
Haemal asked 17/2, 2017 at 17:28
4
Solved
I was trying the differents tutorials in Boost.Asio documentation and tried to replace boost components with C++11 ones. However, I got an error using std::bind in Timer.5 - Synchronising handlers ...
Essive asked 28/1, 2012 at 19:59
1
Solved
I'm on CentOS 6.6 (gcc 4.4.7) and developing with Boost.Asio (1.41). I'd like io_service to call member function run() in manger object m when it starts. The code I'm trying to compile looks like:
...
Alfreda asked 2/3, 2015 at 22:48
1
Solved
I would like to define a function taking 2 arguments
double func(double t, double x);
where the actual implementation is read from an external text file.
For example, specifying in the text f...
Marcasite asked 22/1, 2015 at 23:59
3
Solved
Recently I discovered that shared_ptr does not have pointer to member operator ->*. I created simple example:
template <typename Pointer, typename Function, typename... Args>
auto invoke1...
Themselves asked 17/7, 2013 at 9:55
2
Solved
I noticed that when passing reference parameters to boost bind, those parameters won't act like references. Instead boost creates another copy of the member and the original passed in variable rema...
Shakta asked 22/1, 2009 at 17:19
1
First and foremost, I want to apologize for the lengthy post. I wanted to be as thorough as possible.
I've been stuck on this issue for a few days now, and there is surprisingly little information...
Dekko asked 24/10, 2013 at 17:2
1
Solved
I've always believed that function pointers don't require an ampersand:
Do function pointers need an ampersand
Yet, every example I've seen of using boost::bind shows one, and my compiler - in mo...
Tojo asked 19/8, 2013 at 11:1
4
Solved
Is there any difference between the two? Or am I safe to replace every occurrence of boost::bind by std::bind in my code and thereby remove the dependence on Boost?
Almatadema asked 11/5, 2012 at 16:56
5
Solved
I have a worker class like the one below:
class Worker{
public:
int Do(){
int ret = 100;
// do stuff
return ret;
}
}
It's intended to be executed with boost::thread and boost::bind, like:
...
Cheju asked 11/11, 2009 at 5:14
2
Solved
How many maximum arguments can we pass to boost::bind()
Cherey asked 10/2, 2011 at 10:20
2
Solved
I wrote some code and got scared that it will not work - so I wrote a prototype:
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <iostream>
class base {
private...
Lymphocyte asked 29/4, 2013 at 15:39
1
Solved
The asio library passes an error parameter in a lot of its examples, ie;
http://think-async.com/Asio/asio-1.5.3/src/examples/echo/async_tcp_echo_server.cpp
What's the point of this parameter? Does...
Ninny asked 7/4, 2013 at 6:29
1
In lib Bullet there is defined a type:
typedef void (*btNearCallback)(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo);
in th...
Lalla asked 10/2, 2013 at 23:33
1
Solved
I have some pretty basic test code. I have a class that just logs all operations on it. I bound it to a boost::function object like this:
void Function(const Foo&)
{
printf("Function invoke...
Pieria asked 31/1, 2013 at 3:11
2
Solved
Are there any performance impacts (positive or negative) when binding functions (using Boost Bind) ?
Virgenvirgie asked 16/9, 2012 at 11:45
2
Solved
First i asked this Running a function on the main thread from a boost thread and passing parameters to that function
so now i am trying this:
The following is a console c++ project where i perfec...
Retaretable asked 9/12, 2012 at 7:49
1
Solved
I have some code running in a boost thread that modifies stuff handled by the main thread which is not working and it makes sense.
On android i would have the Handler which is a message queue that...
Blighter asked 3/12, 2012 at 9:54
2
Solved
I just found myself creating a class
template <typename T> struct invoker {
void operator()(T& it) const {it();}
};
so I could pass an invoker<foo> to something (which isn't und...
Europa asked 15/5, 2012 at 23:41
3
Solved
Can I use boost::bind(mycallback, this, _1, _2) across C code?
Update
The short answer is no, boost bind does not return a function pointer, which can be called in C code, but a functor (C++ obje...
Hector asked 27/11, 2011 at 0:3
2
I am trying to understand the difference between these different bind approaches. There is a similar question at boost::bind and boost::phoenix::bind
But, if anyone can explain this with examples...
Surculose asked 7/11, 2011 at 11:27
1 Next >
© 2022 - 2024 — McMap. All rights reserved.