Herve Bronnimann <[EMAIL PROTECTED]> writes: > On Tue, Nov 19, 2002 at 10:35:00AM -0500, David Abrahams wrote: >> > On Tuesday 19 November 2002 07:11, Herve Bronnimann wrote: >> >> Dave, Jeremy: one iterator adaptor I needed often (and once again today) >> >> is the projection on the first or second member of a pair. I could make >> >> it using projection_iterator<> and select1st, except that select1st is >> >> an std extension from SGI. I haven't found any other out-of-the-box way >> >> to do this, did I miss something? >> > >> > Not as far as I can see. >> >> Can't you just use make_projection_iterator with bind(&pair<X,Y>::first) ? > > Would work fine for boost::compressed_pair, but not for std::pair, > IIUC. In one, first is a member function, but in the other it's > just a public data member.
bind supports data members. > Even assuming it works, would it inline the access to first > properly? No, it would "properly" store the data member pointer and indirect through that ;-) -- David Abrahams [EMAIL PROTECTED] * http://www.boost-consulting.com Boost support, enhancements, training, and commercial distribution _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost