Sergio
Sergio

Reputation: 941

Replacing boost::functionN in C++11 with GCC 4.9.2

I'm trying to build (in Windows) with GCC 4.9.2 the eGUI library by John Torjo, removing every dependence from boost.
In several files I find this typedef: typedef std::function1 <void, event_type &> func;
Compiling, I get the following error:
.. \ .. \ Egui \ core \ detail \ event_handler.hpp | 44 | error: 'function1' in namespace 'std' does not name a template type |
The boost documentation defines the Class template FunctionN: boost::FunctionN - A set of generalized function pointers That can be used for callbacks or wrapping function objects. Now, I ask: boost::function1 may be replaced by some standard class? In <functional> I don't seem to find anything that might serve the purpose.

Upvotes: 1

Views: 226

Answers (1)

kennytm
kennytm

Reputation: 523444

You should change all

boost::functionN<R, A, B, C, ...> 

to

std::function<R(A, B, C, ...)>

(The N is irrelevant now, the standard library can calculate the N from the A, B, C, ... list)

Upvotes: 3

Related Questions