
Hi, (CC'ing Peter and Joel) I've developed a patch after a somewhat short discussion on the users list for adding the ability to determine the number of arguments required at minimum for a bind expression. It is developed as a non-intrusive patch to bind and fusion. Basic usage is as follows: #include <boost/bind/min_arity.hpp> template<typename BindExpression> void dispatch(BindExpression const & e,boost::mpl::int_<0>) { // callable as e() } template<typename BindExpression> void dispatch(BindExpression const & e,boost::mpl::int_<1>) { // callable as e(_bi::type_at_index<arg_sequence,1>::type) } template<typename BindExpression> void fn(BindExpression e) { typedef boost::min_arity<BindExpression::type min_arity; dispatch(e,min_arity()); ] The patch is at: http://sohail.taggedtype.net/software/bind_arg_sequence_patch.tar.bz2 To apply: cd /path/to/boost/root tar -xjvf /path/to/bind_arg_sequence_patch.tar.bz2 patch -p0 < bind_arg_sequence.patch I would appreciate any comments. Currently it lacks documentation and I think the generated specializations could stand to be renamed. If you would like me to go further, please let me know. Thank you, Sohail

Sohail Somani wrote:
I'll comment on the fusion side of things. For now, since I did just a cursory look, my comments will be superficial. 1) Please follow fusion coding conventions (e.g. your copyright at the top, spaces instead of tabs, indent styles, etc.) 2) I'm not so sure about using python to generate the specializations. I'd rather see Boost PP code; some examples can be found in the fusion code (e.g. vector1..vectorN). I'd like to avoid the use of an external tool as much as possible. Overall, it looks good! Nice work! Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net

Regarding the indent styles and headers: do you have an emacs style that you use? I will also try to get the specializations generated by Boost PP code. Thanks for your comments! Sohail -----Original Message----- From: boost-bounces@lists.boost.org on behalf of Joel de Guzman Sent: Sun 1/21/2007 5:37 PM To: boost@lists.boost.org Subject: Re: [boost] [Bind] min_arity: the patch I'll comment on the fusion side of things. For now, since I did just a cursory look, my comments will be superficial. 1) Please follow fusion coding conventions (e.g. your copyright at the top, spaces instead of tabs, indent styles, etc.) 2) I'm not so sure about using python to generate the specializations. I'd rather see Boost PP code; some examples can be found in the fusion code (e.g. vector1..vectorN). I'd like to avoid the use of an external tool as much as possible.

Sohail Somani wrote:
Regarding the indent styles and headers: do you have an emacs style that you use?
oops, sorry, me no emacs user. I will also try to get the specializations generated by Boost PP code. cool!
Thanks for your comments!
sure. i'll try to have some more comming.
regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
participants (2)
-
Joel de Guzman
-
Sohail Somani