Click here to Skip to main content
15,916,463 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: WTL multiple UI thread problem Pin
Jörgen Sigvardsson14-Apr-05 21:44
Jörgen Sigvardsson14-Apr-05 21:44 
GeneralRe: WTL multiple UI thread problem Pin
X-Ryl66914-Apr-05 22:23
sussX-Ryl66914-Apr-05 22:23 
GeneralRe: WTL multiple UI thread problem Pin
Stuart Dootson14-Apr-05 23:37
professionalStuart Dootson14-Apr-05 23:37 
GeneralSlim ComboBox class Pin
William Mahoney14-Apr-05 5:11
sussWilliam Mahoney14-Apr-05 5:11 
Generaly a part of data stored into previous ActiveX control loses when i insert new ActiveX Pin
ajalilqarshi13-Apr-05 5:20
ajalilqarshi13-Apr-05 5:20 
GeneralIE programming Pin
Anonymous12-Apr-05 22:49
Anonymous12-Apr-05 22:49 
QuestionSort bug with STL? Pin
starschen12-Apr-05 16:19
sussstarschen12-Apr-05 16:19 
AnswerRe: Sort bug with STL? Pin
Joaquín M López Muñoz13-Apr-05 9:23
Joaquín M López Muñoz13-Apr-05 9:23 
2. predicate 'greater' overriden pair of brackets to compare two elements, when two elements are equal that returns true.

This is the problem. std::sort expects a comparison predicate that implements what in techical terms is called a strict weak ordering[^]: your class greater violates (at least) the irreflexivity condition, i.e. when comparing an element against itself it returns true when it should return false. As you don't play nice with std::sort, this routine won't work.

In less technical terms, the comparison predicate must behave like the numerical < or > relationships do. In your case you have two options:
  • Use the predefined std::greater<UINT> predicate.
  • Define correctly your class. A simple way would be
    struct greater{
      bool operator()(int x1,int x2)const
      {
        return x1>x2;
      }
    };
Hope this helps.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
GeneralRe: Sort bug with STL? Pin
starschen14-Apr-05 18:05
sussstarschen14-Apr-05 18:05 
QuestionHow to get _Application pointer from _Document pointer in MS Word Pin
ajalilqarshi11-Apr-05 20:34
ajalilqarshi11-Apr-05 20:34 
GeneralTo all the WTL gurus Pin
mango_lier11-Apr-05 18:05
mango_lier11-Apr-05 18:05 
QuestionSTL from visual C++ in Unix??? Pin
knapak11-Apr-05 14:33
knapak11-Apr-05 14:33 
AnswerRe: STL from visual C++ in Unix??? Pin
ThatsAlok11-Apr-05 19:45
ThatsAlok11-Apr-05 19:45 
AnswerRe: STL from visual C++ in Unix??? Pin
Stuart Dootson11-Apr-05 20:51
professionalStuart Dootson11-Apr-05 20:51 
AnswerRe: STL from visual C++ in Unix??? Pin
markkuk12-Apr-05 0:41
markkuk12-Apr-05 0:41 
QuestionHow to activate the File-Open Dialog via ellipsis button (&quot;...&quot;)in property browser Pin
knaster bax11-Apr-05 7:43
knaster bax11-Apr-05 7:43 
AnswerRe: How to activate the File-Open Dialog via ellipsis button (&quot;...&quot;)in property browser Pin
ThatsAlok11-Apr-05 19:47
ThatsAlok11-Apr-05 19:47 
GeneralRe: How to activate the File-Open Dialog via ellipsis button (&quot;...&quot;)in property browser Pin
knaster bax11-Apr-05 23:17
knaster bax11-Apr-05 23:17 
GeneralNeed Help Pin
inbakumar.G11-Apr-05 5:12
inbakumar.G11-Apr-05 5:12 
Generalx to Bin ? or x to Hex To Bin Pin
Static(x)10-Apr-05 23:11
Static(x)10-Apr-05 23:11 
GeneralReferencing CArray's within CArrays Pin
KoriFrancis10-Apr-05 12:18
KoriFrancis10-Apr-05 12:18 
General[wtl]CHyperLink bRet = (dwRet &gt; 32); Pin
Tommy2d8-Apr-05 2:33
Tommy2d8-Apr-05 2:33 
GeneralRe: [wtl]CHyperLink bRet = (dwRet &gt; 32); Pin
Michael Dunn8-Apr-05 8:05
sitebuilderMichael Dunn8-Apr-05 8:05 
GeneralRe: [wtl]CHyperLink bRet = (dwRet &gt; 32); Pin
Tommy2d10-Apr-05 8:03
Tommy2d10-Apr-05 8:03 
GeneralCDateTimePickerCtrl - CDateTimeCtrl Pin
The Professor8-Apr-05 1:30
The Professor8-Apr-05 1:30 

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.