Click here to Skip to main content
15,886,774 members

Comments by jean Davy (Top 13 by date)

jean Davy 30-Mar-11 12:57pm View    
Deleted
Reason for my vote of 1
Why so complicated ?
Have a look to my alternate...
jean Davy 1-Feb-11 14:17pm View    
Yes, of course sorting point is like "put the finger in a gear", you know when it starts, not when it ends...
In fact I did that for pedagogy, as if he reads documentation on set container, a whole world will open before him ! Gloria, Gloria ...
jean Davy 1-Feb-11 6:58am View    
Hey, you are a student ? And you want I do your exercise ! :mad:
Ok, I do it, this is THE C++ response:

<pre>
template<>
struct std::less< CPoint >
{ // functor for operator<
bool operator()(const CPoint& _Left, const CPoint& _Right) const
{ // apply operator< to operands
if( _Left.x < _Right.x )
return true;
if( _Left.y < _Right.y )
return true;
return false ;
}
};


....

CPoint Pts[]={
CPoint( 1, 2),
CPoint( 3, 4),
CPoint( 3, 4)
};
std::set< CPoint > Set( Pts, Pts + _countof( Pts ) );
</pre>
Easy to improve with angle before x,y...
jean Davy 14-Jan-11 11:52am View    
New life !
Good luck...
jean Davy 5-Jan-11 5:45am View    
Deleted
Reason for my vote of 3
no more than that: http://msdn.microsoft.com/en-us/library/dd183391(v=vs.85).aspx