0
votes
1answer
24 views

Binding with boost works while with std doesnt, whats the diffrence?

I tried to bind a function with std::bind, it kept saying that there is no overload for my set of arguments. It worked with boost::bind. Whats the diffrence between std and boost bind? Im using: ...
1
vote
1answer
44 views

How to avoid boost::phoenix when generating with boost::spirit::karma

I'm a victim of error "LNK1179: invalid or corrupt file: duplicate COMDAT" and these sources lead me to believe that by not using phoenix I could avoid this error. (This is a follow-up to my ...
1
vote
0answers
43 views

What is a clean way to represent a bind in a uml diagram?

I would like to represent the following code using a UML diagram: #include <iostream> #include <boost/bind.hpp> using namespace std; class A { public: void bar() {std::cout << ...
1
vote
1answer
57 views

Boost binding error in completion handler

I encountered an binding error /usr/local/include/boost/bind/bind.hpp:457: error: invalid use of void expression My program is about an asynchronous action using a callback handler as following: ...
2
votes
1answer
29 views

Boost undefined reference error with boost::bind overloaded operators

The code in question: boost::function<bool()> isSpecialWeapon = boost::bind(&WeaponBase::GetType,this) == WeaponType::SPECIAL_WEAPON; The error I get is something like so: undefined ...
0
votes
1answer
44 views

Encapsulating boost::signal and boost::bind

I have a problem now. I am trying to encapsulatie boost::signal and boost::bind into my own Event class. class MyEvent { private: boost::signal<void ()> Sig; public: void ...
1
vote
2answers
61 views

Boost::Bind and virtual function overloads: why do they work?

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: ...
1
vote
2answers
76 views

How can I resolve ambiguity of boost::signals2's slot_type and boost::bind, and why is it even ambiguous?

Considering this example: #include <boost/signals2/signal.hpp> #include <boost/bind.hpp> typedef boost::signals2::signal< void ( double ) > DoubleSignalType; typedef ...
0
votes
1answer
91 views

boost::bind implicit conversion to boost::function or function pointer

I'm using boost::function like this: template<class T1> void run(boost::function<void (T1)> func, string arg) { T1 p1 = parse<T1>(arg); func(p1); } When used like this, ...
0
votes
1answer
40 views

What's the use of asio::placeholder::error

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 ...
0
votes
1answer
68 views

Generic function bind() with Boost

I have some C-style functions that return 0 to indicate success, and != 0 on error. I'd like to "wrap" them into void functions that throw instead of returning a value. I have written this helper: ...
2
votes
2answers
51 views

How to copy with member access using boost

I have a container of As with struct A { int f(); } The container offers iterators and we can for this example assume it's an std::vector. So: std::vector<A> As; Now I want to copy the ...
0
votes
1answer
72 views

How do I use tr1 function and bind for functions with changing parameters?

I'm currently going from C# to C++ and rewriting some game engine code and I think I'm at a wall with tr1; Essentially what I want to do is have an input layer take input from the touchscreen and then ...
1
vote
2answers
140 views

Passing function pointer arguments with boost

Can the following function pointer passing be simplified/improved with the use of boost::function and/or boost::bind? void PassPtr(int (*pt2Func)(float, std::string, std::string)) { int result = ...
0
votes
2answers
125 views

How to pass signal callbacks (using boost::bind)

I'm writing a wrapper for boost::signals2::signal to get a cleaner, more easy to use interface. Here's what I've come up with: #include <boost/signals2.hpp> // Wrapper class template for ...

1 2 3 4 5 9
15 30 50 per page