Board index » cppbuilder » How to Use stable_sort for TPoint array?
Wiz
CBuilder Developer |
How to Use stable_sort for TPoint array?2006-01-05 07:22:48 PM cppbuilder47 Hi everybody, I have lots of trouble when I try to use stable_sort algorithm so Ican readjust hte TPoitn values within TPoint arrea in the following manner TPoint OldArray[4], NewArray[4]; OldArray[0].x = 200; OldArray[0].y = 400; OldArray[1].x = 300; OldArray[1].y = 300; OldArray[2].x = 100; OldArray[2].y = 500; OldArray[3].x = 150; OldArray[3].y = 200; The value within NewArray would be something like this: NewArray[0].x = 150; NewArray[0].y = 200; NewArray[1].x = 300; NewArray[1].y = 300; NewArray[2].x = 200; NewArray[2].y = 400; NewArray[3].x = 100; NewArray[3].y = 500; However, the BCB6 compiler keeps complaining as follows: [C++ Error] _function_base.h "E2093 Operator 'operator <' not implemented in type 'TPoint' for arguments of the same type" How can I dealwith this kind of problem? Any alternative so I can dela with stable_sort problem wihotu headache ..... |