Boost logo

Boost Users :

From: Tom Matelich (tmatelich_at_[hidden])
Date: 2003-05-13 12:23:39


Define easier :) Not to be picky, but how little do you expect to have to
type?

1) write your own algorithm find_if_equal, then you only need one bind (~10
lines of code separate from your call)
2) write a functor, ObjectNameCompare (less than 15 lines of code separate
from your call)

> -----Original Message-----
> From: Russell Hind [mailto:yg-boost-users_at_[hidden]]
> Sent: Tuesday, May 13, 2003 9:31 AM
> To: boost-users_at_[hidden]
> Subject: [Boost-Users] find_if and calling a member function
>
>
> I have an object that has a member get_name which returns a
> string. I
> have a collection of these objects and would like to find one with a
> particular name. I am currently using find_if, equal and bind
>
> find_if(objects.begin(), objects.end(),
> bind(equal_to<string>(), name, bind(&object::get_name, _1)));
>
> Given Lambda doesn't compile under BCB6, is there an easier way to do
> this rather than having to make up 2 bind statements?
>
> Thanks
>
> Russell
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Rent DVDs Online - Over 14,500 titles.
> No Late Fees & Free Shipping.
> Try Netflix for FREE!
> http://us.click.yahoo.com/YoVfrB/XP.FAA/uetFAA/EbFolB/TM
> --------------------------------------------------------------
> -------~->
>
> Info: <http://www.boost.org>
> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
> Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>

-----------------------------------------------------------------------
DISCLAIMER: Information contained in this message and/or
attachment(s) may contain confidential information of Zetec, Inc.
If you have received this transmission in error, please notify
the sender by return email.
-----------------------------------------------------------------------


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