Groups
Groups
Sign in
Groups
Groups
comp.lang.c++
Conversations
About
Send feedback
Help
Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss
Learn more
Find minimum
41 views
Skip to first unread message
Christopher Pisz
unread,
Jan 23, 2015, 7:16:33 PM
1/23/15
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I need to get the element of a vector that returns the smallest value
when one of its member functions is called.
Suppose I have
struct Person
{
typedef std::shared_ptr<Person> Shared_Ptr;
int m_height;
}
How do I get the shortest person from
std::vector<Person::Shared_Ptr>
without looping through it myself?
Is there an std::algorithm and how would I write the predicate? Or do I
sort and use a predicate?
red floyd
unread,
Jan 23, 2015, 7:52:13 PM
1/23/15
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
std::min_element has a form that takes a comparator.
0 new messages