1
vote
1answer
37 views

how to pass pointer to member function of a template class?

I just faced an interesting challenge, let's solve it together: I had a Broker class similar to this: //Broker.h #pragma once #include <boost/shared_ptr.hpp> template<class ...
0
votes
1answer
90 views

error C2664 cannot convert parameter 1 from 'std::string (__thiscall ClassName::* )(std::string)' to 'std::string (__cdecl *)(std::string)

I'm making a unmanaged application to handle an event fired in c# here. FYI:: I want to handle a custom event when my Name property in C# class is changed. I have gone through the following links: ...
8
votes
4answers
954 views

What's the point of using boost::mem_fn if we have boost::bind?

I'm having a look at the Boost libraries that were included in C++'s Technical Report 1 and trying to understand what each does. I've just finished running an example for boost::mem_fn and now I'm ...
0
votes
0answers
71 views

How to get the function pointer of a function being called by another function for boost::call_once?

I understand what is needed to properly call boost's call_once function but I am unsure how to do when I have a function calling another function. Is it even possible? I have the following as an ...
0
votes
0answers
88 views

boost.python: pointer to static function

I have some C++ function (not mine, so i can't edit): void MyClass::SetOnConnect(bool (*pfn)(void * pParam), void * pParam) { pfnCallBack = pfn; pCallBackParam = pParam; } later in code it will ...
4
votes
6answers
330 views

map of pointers to functions of different return types and signatures

I am looking for a way to call different functions by a string input. I have a map that ties each unique string to a function pointer and a lookup function to search the map and return a pointer if ...
0
votes
1answer
251 views

Using boost::function and boost::bind to a member variable

I'm trying to create a boost::function that allows setting of a member variable of an object. I've created the simplest example I can think of to get across what I'm trying (and failing) to do. I feel ...
3
votes
4answers
396 views

Vector of functions with parameters

I have made vectors that contain functions, but they had no argument list. Also, they were not inside of a class. I have a class named Dialog, and I need to store function-pointers with a specific ...
1
vote
2answers
152 views

C++ class member callback and external library

I would like to solve this issue about class member function callback. Imagine you have a function from an external library (which cannot be modified!) like this: void fortranFunction(int n, void ...
3
votes
2answers
134 views

Why is c++ template argument deduction failing in this case?

I am trying to write my own delegate system as a replacement for boost::functions since the latter does a lot of heap-allocations which I profiled to be problematic. I have written this as a ...
0
votes
3answers
544 views

boost::bind return a function object which is the argument for a function that requires pointer

I am doing C++ coding on Linux about boost::bind. The return data type of boost::bind is a function object, which is an input argument to another function bridge_set_pound_var_func. But, ...
0
votes
2answers
631 views

C++ callback for non-static function between different classes

I have a Class A which I intend to put in a shared library as it interacts with the device drivers. I have a Class B and may be C,D,E... in future which will use the class A using the shared library. ...
4
votes
1answer
448 views

Boost fast pool allocator has problems with function pointers?

Is this a Boost bug or am I doing something wrong? #include <map> #include <boost/pool/pool_alloc.hpp> int main() { typedef const std::string key; typedef double* (*value)(const ...
1
vote
3answers
463 views

How can I use a std::tr1::function object in a key to unordered_map?

I'm trying to form a std::tr1::unordered_map where the key type is a struct that includes a callback function, for which I'm using std::tr1::function. I'm running into two problems: 1) the function ...
1
vote
1answer
452 views

Boost::Variant and function_types in it: How to put functions into Boost::variant?

Lirics: I try to implement a task pool over MPI. So I need some kind of RPC but one that would work between difrent parts of my programm, meaning processor A wants processor B to call function C with ...

1 2
15 30 50 per page