|
Boost Users : |
From: Sohail Somani (s.somani_at_[hidden])
Date: 2007-01-16 21:06:04
-----Original Message-----
From: Sohail Somani
Sent: Tue 1/16/2007 6:02 PM
To: boost-users_at_[hidden]; boost-users_at_[hidden]
Subject: RE: [Boost-users] [Bind] arity of arbitrary object
-----Original Message-----
From: boost-users-bounces_at_[hidden] on behalf of Peter Dimov
No, this doesn't quite work. It says that bind( f, _5 ) has arity 1, but the
correct answer is 5. Similarly, it says that bind( f, 1, 2 ) has arity 2,
while the correct answer is 0. You need something like (pseudocode)
arity( _bi::bind_t<R,F,L> ) :- max( arity( e ) ) for each e in L
arity( X ) :- is_placeholder<X>::value
This could be much easier with a bind that uses a fusion tuple as L. :-)
------------
Ok so now the attached version doesn't have the issues which you pointed out. Is there a way (using mpl) to get the max element in a sequence?
------------
Argh, bind(f,1,2) has incomplete type. Will fix later :)
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net