Project

General

Profile

Actions

Support #1140

closed

Anyone knot how to do sth like that: std::sort(dbo::ptr<User> vecUsers.begin(), dbo::ptr<User> vecUsers.end(), sortByname);

Added by Kris Duraj over 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
01/19/2012
Due date:
% Done:

0%

Estimated time:

Description

Hi

This is the method to sorting vector but it's not compiling when I have vector dbo::ptr.

For example function :

void sortByname(dbo::ptr first, dbo::ptr second)

{

return (first~~name < second~~>name);

}

Anyone know how to sort vector of dbo::ptr ?

Thanks

Kris

Actions #1

Updated by Koen Deforche over 12 years ago

  • Status changed from New to Feedback

Hey,

I can't thinking of a special complication, and your comparison function seems fine. What is the exact error you get? Could you reproduce it in a small test case?

Regards,

koen

Actions #2

Updated by Kris Duraj over 12 years ago

Hey,

It was my stupid false, I didn't add "static" to my class function sortByName. Now everything works fine.

Thanks for your answer.

Kris

Actions #3

Updated by Koen Deforche about 12 years ago

  • Status changed from Feedback to Resolved

Great. Problem solved !

Actions #4

Updated by Koen Deforche about 12 years ago

  • Status changed from Resolved to Closed
  • Target version set to 3.2.1
Actions

Also available in: Atom PDF