Home » U++ Library support » U++ Core » How to bind parameter to PostCallback with Function, Event object (Problem with binding to PostCallback)
How to bind parameter to PostCallback with Function, Event object [message #47911] |
Sat, 22 April 2017 23:10 |
|
Klugier
Messages: 1076 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
I forced problem when compiling Unique from bazaar. The problem is that I can not bind Event to Post callback. Here is the problem:
Event<const Vector<String>&> WhenInstance; // Class member
PostCallback(WhenInstance, v); // How to post that callback, do i need something like std::bind?
All help is welcome
__________________________________________________
Solution:
PostCallback([=, &v]() { WhenInstance(v); } );
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Sat, 22 April 2017 23:54] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat May 11 17:39:12 CEST 2024
Total time taken to generate the page: 0.01476 seconds
|