Click here to Skip to main content
15,913,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A question about IE Pin
Stephane Rodriguez.30-Apr-03 3:17
Stephane Rodriguez.30-Apr-03 3:17 
GeneralProblem with CRecordSet Pin
Poul Haahr Klemmensen30-Apr-03 1:46
Poul Haahr Klemmensen30-Apr-03 1:46 
GeneralRe: Problem with CRecordSet Pin
David Crow30-Apr-03 2:50
David Crow30-Apr-03 2:50 
GeneralRe: Problem with CRecordSet Pin
Poul Haahr Klemmensen30-Apr-03 2:59
Poul Haahr Klemmensen30-Apr-03 2:59 
GeneralSTL algorithm Pin
Rage30-Apr-03 1:36
professionalRage30-Apr-03 1:36 
GeneralRe: STL algorithm Pin
markkuk30-Apr-03 2:10
markkuk30-Apr-03 2:10 
GeneralRe: STL algorithm Pin
Rage30-Apr-03 5:42
professionalRage30-Apr-03 5:42 
GeneralRe: STL algorithm Pin
User 988530-Apr-03 2:18
User 988530-Apr-03 2:18 
A very quick response - not much thought went into it. Please check it before using.

Sort the vector descending

ie, {1120, 962, 84, 53, 2, 0}

Now look for the first value less than 250

comparison fn:

bool compare(value1, value2)
{
return value1 < value2;
}
std::lower_bound(vec.begin(), vector.end(), 250, compare);

returns the required iterator.

Thomas


My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers


modified 29-Aug-18 21:01pm.

GeneralRe: STL algorithm Pin
Rage30-Apr-03 5:42
professionalRage30-Apr-03 5:42 
GeneralRe: STL algorithm Pin
Giles30-Apr-03 2:35
Giles30-Apr-03 2:35 
GeneralRe: STL algorithm Pin
Rage30-Apr-03 5:41
professionalRage30-Apr-03 5:41 
GeneralRe: STL algorithm Pin
Andrew Walker30-Apr-03 2:55
Andrew Walker30-Apr-03 2:55 
GeneralRe: STL algorithm Pin
Rage30-Apr-03 5:40
professionalRage30-Apr-03 5:40 
QuestionCan I use 1 template function instead of 2? Pin
grscot30-Apr-03 1:28
grscot30-Apr-03 1:28 
AnswerRe: Can I use 1 template function instead of 2? Pin
Pankaj Singh30-Apr-03 3:42
Pankaj Singh30-Apr-03 3:42 
GeneralEditor Pin
y_seval30-Apr-03 1:06
y_seval30-Apr-03 1:06 
GeneralRe: Editor Pin
Neville Franks30-Apr-03 1:40
Neville Franks30-Apr-03 1:40 
GeneralDateTimePicker problem! Pin
_skidrow_vn_30-Apr-03 1:03
_skidrow_vn_30-Apr-03 1:03 
GeneralRe: DateTimePicker problem! Pin
David Crow30-Apr-03 3:01
David Crow30-Apr-03 3:01 
GeneralRe: DateTimePicker problem! Pin
_skidrow_vn_30-Apr-03 7:49
_skidrow_vn_30-Apr-03 7:49 
GeneralTwo Rich Edit Questions Pin
Gio S.29-Apr-03 23:03
Gio S.29-Apr-03 23:03 
GeneralRe: Two Rich Edit Questions Pin
John R. Shaw30-Apr-03 9:27
John R. Shaw30-Apr-03 9:27 
GeneralCRichEdit & smtp mail problem Pin
granburu29-Apr-03 22:03
granburu29-Apr-03 22:03 
GeneralWindow handle of a process-code required Pin
RaajaOfSelf29-Apr-03 21:59
RaajaOfSelf29-Apr-03 21:59 
GeneralRe: Window handle of a process-code required Pin
Rage30-Apr-03 0:51
professionalRage30-Apr-03 0:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.