How many maximum arguments can we pass to boost::bind()
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
- What is the correct way to declare and use a FILE
by default it's 9.
http://www.boost.org/doc/libs/1_45_0/libs/bind/bind.html#NumberOfArguments
Even if you can't switch to C++11, you should consider switching from boost::function to the TR1 functions, which was a preview for C++11
Basically, what started out as boost::function became part of the C++ standard library, which nowadays is defined with variadic templates. In a nutshell this means that there is no hard limit anymore (but you might need to define additional placeholder variables if you need something beyond
_19
)To switch from boost::function to std::tr1 do the following
find all occurences of
#include <boost/function>
and#include <boost/bind>
and replace them by:This should work as a drop-in replacement. If you happen to switch to C++11 later, just throw out the "tr1" part.