Project

General

Profile

Actions

Support #1140

closed
KD

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

Support #1140: 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 almost 15 years ago. Updated over 14 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

KD Updated by Koen Deforche almost 15 years ago Actions #1

  • 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

KD Updated by Kris Duraj almost 15 years ago Actions #2

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

KD Updated by Koen Deforche almost 15 years ago Actions #3

  • Status changed from Feedback to Resolved

Great. Problem solved !

KD Updated by Koen Deforche over 14 years ago Actions #4

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

Also available in: PDF Atom