I've been trying to track down what the maximum number of arguments that can be added to boost::function<> is. I'm starting to believe that the maximum number is 10 arguments. As it seems that when I input 11 arguments VS complains with this error: Error 1 error C2079: 'my_func' uses undefined class
'boost::function<Signature>' Error 2 error C2440: 'initializing' : cannot convert from 'void (__cdecl *)(const char *,affine_transformation_range *,int,int,double,int,int,int,int,int,char)' to 'int'
My declaration looks like as follows: function<void (const char*,affine_transformation_range*,int,int,double,int,int,int,int,int,char)> my_func(&XClass:build_with_cache_pool); My member function is given by: static void build_with_cache_pool(const char * image_name, affine_transformation_range * range, int maximum_number_of_points_on_model,int number_of_generated_images_to_find_stable_points, double minimum_number_of_views_rate, int patch_size, int yape_radius, int number_of_octaves, int number_of_ferns, int number_of_tests_per_fern, char temp); Any help with this project would be greatly appreciated. -- Thanks, Ryan Lovelett
AMDG Ryan Lovelett wrote:
I've been trying to track down what the maximum number of arguments that can be added to boost::function<> is. I'm starting to believe that the maximum number is 10 arguments. As it seems that when I input 11 arguments VS complains with this error:
That sounds right. You can increase the limit by #define BOOST_FUNCTION_MAX_ARGS 20 #include <boost/function.hpp> The absolute limit without modifying boost/function/detail/maybe_include.hpp is 50 arguments. In Christ, Steven Watanabe
On Tue, Jun 24, 2008 at 8:04 PM, Steven Watanabe <watanabesj@gmail.com> wrote:
AMDG
Ryan Lovelett wrote:
I've been trying to track down what the maximum number of arguments that can be added to boost::function<> is. I'm starting to believe that the maximum number is 10 arguments. As it seems that when I input 11 arguments VS complains with this error:
That sounds right. You can increase the limit by
#define BOOST_FUNCTION_MAX_ARGS 20 #include <boost/function.hpp>
The absolute limit without modifying boost/function/detail/maybe_include.hpp is 50 arguments.
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Steve, thanks so much for that trick! It worked like a charm. -- Ryan Lovelett Ryan.Lovelett@gmail.com (352) 286-8637
On Wed, Jun 25, 2008 at 3:55 PM, Ryan Lovelett <ryan.lovelett@gmail.com> wrote:
On Tue, Jun 24, 2008 at 8:04 PM, Steven Watanabe <watanabesj@gmail.com> wrote:
AMDG
Ryan Lovelett wrote:
I've been trying to track down what the maximum number of arguments that can be added to boost::function<> is. I'm starting to believe that the maximum number is 10 arguments. As it seems that when I input 11 arguments VS complains with this error:
That sounds right. You can increase the limit by
#define BOOST_FUNCTION_MAX_ARGS 20 #include <boost/function.hpp>
The absolute limit without modifying boost/function/detail/maybe_include.hpp is 50 arguments.
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Steve, thanks so much for that trick! It worked like a charm.
--
Ryan Lovelett Ryan.Lovelett@gmail.com (352) 286-8637
So now I've hit the next logical error in this that, I believe is a related issue. boost::bind() only allows for 10 arguments, so I assume I'm going to either have to specify a processor that allows bind to take 20 arguments. Or am going to have to extend bind to allow it to take more? Any help pointing me in the right direction would be greatly appreciated. -- Ryan Lovelett Ryan.Lovelett@gmail.com
AMDG Ryan Lovelett wrote:
So now I've hit the next logical error in this that, I believe is a related issue. boost::bind() only allows for 10 arguments, so I assume I'm going to either have to specify a processor that allows bind to take 20 arguments. Or am going to have to extend bind to allow it to take more? Any help pointing me in the right direction would be greatly appreciated.
For bind, there is no PP symbol which can adjust the limit. Take a look at the header boost/bind.hpp. Everything is written out explicitly. In Christ, Steven Watanabe
participants (2)
-
Ryan Lovelett
-
Steven Watanabe