HELP! can't sort a STL list

I declare a list like this:
               std::list<swedSim> usedSimList;
and a compare function to sort it:
     bool lt_fun_equip(const swedSim& s1, const swedSim& s2)
     return s1._maxAssEquipment - s1._assEquipmentCount - s1._assEquipmentRequestCount <
                    s2._maxAssEquipment - s2._assEquipmentCount - s2._assEquipmentRequestCount;
when I try to sort the list, this way:
                         usedSimList.sort(lt_fun_equip);
I get the following compile error:
"/opt/SUNWspro/WS6U2/include/CC/Cstd/./list.cc", line 351: Error: Too many arguments in call to "std::list<srh::swedSim, std::allocator<srh::swedSim>>::__adjacent_merge(std::list<srh::swedSim, std::allocator<srh::swedSim>>::iterator, std::list<srh::swedSim, std::allocator<srh::swedSim>>::iterator, std::list<srh::swedSim, std::allocator<srh::swedSim>>::iterator)".
"taskReqAssociation.cpp", line 268: Where: While instantiating "std::list<srh::swedSim, std::allocator<srh::swedSim>>::sort(bool(*)(const srh::swedSim&,const srh::swedSim&))".
"taskReqAssociation.cpp", line 268: Where: Instantiated from non-template code.
Any help would be highly appreciated!
Thank you in advance

     struct ltsim_equip : public binary_function<swedSim, swedSim, bool>
     bool operator()(const swedSim& s1, const swedSim& s2) const
          long diff;
          diff = s1._maxAssEquipment - s1._assEquipmentCount - s1._assEquipmentRequestCount -
                    s2._maxAssEquipment + s2._assEquipmentCount + s2._assEquipmentRequestCount;
     return (diff == 0 ? (s1._lastModDate < s2._lastModDate) : (diff > 0));
     bool lt_fun_acc(const swedSim& s1, const swedSim& s2)
          long diff;
          diff = s1._maxAssAccessory - s1._assAccessoryCount - s1._assAccessoryRequestCount -
                    s2._maxAssAccessory + s2._assAccessoryCount + s2._assAccessoryRequestCount;
     return (diff == 0 ? (s1._lastModDate < s2._lastModDate) : (diff > 0));
     void taskAssocReq::execute ()
          //define a list and an iterator
          std::list<swedSim> simList;
          std::list<swedSim>::iterator simIterator;
                         simList.clear();
// the following statement will initialize the list
                         lastProspectIsValid = getSimList(imeiItem->_prospectNum, simList, db);
                    if (imeiItem->isAccessory() && (simListSortedBy != ACCESSORIES)) {
                         simList.sort(lt_fun_acc); // THIS ONE WORKS
                         simListSortedBy = ACCESSORIES;
                    } else if (imeiItem->isEquipment() && (simListSortedBy != EQUIPMENTS)) {
                         simList.sort(ltsim_equip()); // THIS ONE DOES NOT!!!
                         simListSortedBy = EQUIPMENTS;

Similar Messages

  • Can we sort saved report list by name

    Hi,
    I have interactive reports and users can open this interactive report and according to their different requirements they can save this report(as a public) with different names.
    Ex: interactive reports
    Reports(lov) :1.Primary report
    2.xxx test
    3.yyyy
    4.abcd test
    5.zzzz test
    Can we sort saved report list by name?
    Could you please guide me to achieve this requirement.
    Thanks in advance.
    Regards
    Narender B

    Narender wrote:
    Hi,
    I have interactive reports and users can open this interactive report and according to their different requirements they can save this report(as a public) with different names.
    Ex: interactive reports
    Reports(lov) :1.Primary report
    2.xxx test
    3.yyyy
    4.abcd test
    5.zzzz test
    Can we sort saved report list by name?
    Could you please guide me to achieve this requirement.It's a lot easier to do so if the following information is provided (as has been repeatedly pointed out to you):
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    Sorting of the saved report list by report name was introduced in APEX 4.1.

  • How can I sort the target list in debug form.

    If I want to select a procedure/function to debug it is very hard to find it if the package contains a lot of procedures. How can I sort the target list. I did not find anything in the preferences. Thanks.

    Sorry, can't be done. You can request this at the SQL Developer Exchange though, so other users can vote and add weight for possible future implementation.
    My suggestion (if you decide to request it): base the order in the dialog on the order inside the navigator tree (location in the source by default, but possible by name or type/name - see tree's context menu).
    Regards,
    K.

  • How can I sort the delegates list?

    I am using iCal in an office situation and am managing a large number (15) of delegates (they all have their own calender).
    I can sort the delegates list via Preferences, Accounts, Delegation and then add the delegates I need in the order that I prefer.
    But I am looking for a more easier way to sort this list.
    Who can help me with this?

    Hi Katherine,
    You have to specify the order manually I'm afraid.
    Regards,
    Jamie

  • HT204406 I used Match, and now there are artists missing when I search by artist, yet they are in my library when I search by song. If they are in many song list,  why aren't they in my artist list? Also I can't sort my songs by artist on iPhone,  so thes

    I used Match, and now there are artists missing when I search by artist, yet they are in my library when I search by song. If they are in many song list,  why aren't they in my artist list? Also I can't sort my songs list by artist on iPhone,  so their music is basically lost in space....help

    It's not clear from your post, but you do realise
    that if you import a cd as a compilation, it will not
    appear under artists? This is done to save the iPod
    being cluttered up with single artists entries who
    might have only one song listed.
    I wasn't aware of that. It's true that I haven't been using the "compilation" tag for a long time. I've only started using it with iTunes 7 as otherwise with Coverflow I would have one album cover for each artist in a compilation. Before that my compilations weren't tagged as such as that is quite probably why each artist from compilations showed up when browsing by artists.
    Message was edited by: Didou

  • Sorting singly linked list with minimum time complexity

    Hi ...
    anyone could tell me how can i sort singly linked list with minimum time complexity .... ????
    Regards...

    By MergeSort or QuickSort O(n log n). But then you
    have to first extract the objects in the list,sort
    them, then rebuild the list. But it will still bealot
    faster than by keeping the list linked.Technically, I believe insertion sort is marginally
    faster for small n ( <20 or so).Woohoo! So for 20 out of the possible 2147483648 array
    sizes Insetion is faster!
    Unfortunately, checking for that case probably wastes
    all the time you get from using the faster sort...
    That would depend on the actual distribution off array sizes. So it's an engineering decision.
    Sylvia.

  • Just updated to iCloud, but I can't find the 'purchased' list on the itunes store on my iphone. There's no button for it on the toolbar or under the 'more' option. Want to play/download my puchased music via iCloud on my iPhone.... Help someone please?!

    Just updated to iCloud, but I can't find the 'purchased' list on the iTunes store on my iPhone. There's no button for it on the toolbar or under the 'more' option. Want to play/download my puchased music via iCloud on my iPhone.... Help someone please?!

    Hi again Limons,
    just got your last reply per mail, re: 'presently only available in the USA.'
    Unfortunately, you're right. Just found this article: http://www.digitalmusicnews.com/stories/061011icloud
    seem like it's going to be a while before this gets sorted out . . .
    Frustrating outcome to my question, but thanks a lot for helping me sort out what the problem was :-)
    All the best to you.

  • How do I transfer my checked songs from one computer to another - tried exporting library playlist etc but no luck! Please help! I have 26,000 songs - 17,000 are selected and I can't run down the list on my new computer and re-check 17,000 songs! Thanks!

    How do I transfer my checked songs from one computer to another - tried exporting library playlist etc but no luck! Please help! I have 26,000 songs - 17,000 are selected and I can't run down the list on my new computer and re-check 17,000 songs! Thanks!

    Make a smart playlist of your whole library but only checked songs - #4 on  http://support.apple.com/kb/ht1801
    Highlight all files in that playlist, then drag to the other drive.  This isn't preserving any playlists or whatever, just copying files from one drive to another.
    You might want to delete the smart playlist this once you are done because it will probably gobble up resources with that many files.

  • How can I sort the words in a document into an alphabetical list?

    How can I sort the words in a document into an alphabetical list? Thanks!

    writer888 wrote:
    How can I sort the words in a document into an alphabetical list? Thanks!
    Copy the words to the Mac's clipboard (Edit menu> Copy)
    Paste into TextEdit 
    Next open the Edit > Find > Find window in Text Edit.
    Highlight a space between two words and Edit menu > copy, paste into the Find field
    Next create a return in the middle of your text and copy that and paste into the Replace field
    Click Replace All.
    Now Edit > Select All and Edit > Copy
    Open a Spreadsheet program with Sort ability and paste into the second column cell from the top
    place a "a" into the top column cell, select the entire colum
    Sort desending order
    Now if you need it out of spreadsheet format, then your going to need to copy just the data cells (not the entire column to avoid problems) and Paste "Special" as unformatted text into a word processing program
    If you need to get rid of the Returns, do the opposite you did in Text Edit, replace the Returns with Spaces
    A chore, but it's rare one needs to sort words into alaphabetical order.
    FYI, I used TextEdit and the free LibreOffice (Spreadsheet and Word Processing) for the above effects.

  • How can I sort photos within an event? When I follow the Help instructions, I can sort manually in Photo format, but when I return to Event format, the original order is restored.

    How can I sort photos within an event? When I follow the Help instructions, I can sort manually in Photo format, but when I return to Event format, the original order is restored.

    Events are organisation for those who can't really be bothered. They are automatic - based entirely on Date and Time the camera records the photos as taken.
    You can move photos between Events, you can Merge Events, you can Rename them and sort them in various ways except one: You cannot manually sort in an Event as Events are all automated.
    If you want to manually sort in an Event then you've outgrown Events as an organising tool. Now it's time to look at albums (Where you can manually sort) which are much more flexible than Events as an organising tool.

  • Can you sort ibookshelf books by collections and list all of the books in each collection?

    can you sort ibookshelf books by collections and list all of the books in each collection?

    The collection changes a little by the criteria you use to view the books, and you can view them by Title, Author, and Category. So, yes, you can.
    The default view is Book view. On the upper right part of the page, you'll see four white blocks - that's the icon for book view. The icon on the right has three white lines; that's where you find Title, Author, and Category view. You can't create folders in any view.

  • Why can't I buy any app ? Iv tried creating a new Appel account ect but it says the same thing everytime . Sorry your payment was declined . How can I sort this ? Please help

    Why can't I buy any app ? Iv tried creating a new Appel account ect but it says the same thing everytime . Sorry your payment was declined . How can I sort this ? Please help

    - Try another payment method.
    - Contact iTunes
    Apple - Support - iTunes - Contact Us
    - Create a NEW account using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card

  • HT1766 While updating my iphone 4S to the recommended iOS I lost my contacts.  Can anyone help me to restore my contact list?

    While updating my iphone 4S to the recommended iOS update I inadvertantly lost my contacts in the icloud.  Can anyone help me to retrieve my contact list.  iCloud is not something that I need or find helpful for since I only have one device.

    Hi Mandy,
    Check Settings>General>Restrictions, and make sure that under Allow Changes, you have "Allow Changes" checked.
    Cheers,
    GB

  • HT201413 i tried to resore my iphone 3GS with itunes but it is showing an error 29 , can anyone help me to sort out this problem?

    i tried to resore my iphone 3GS with itunes but it is showing an error 29 , can anyone help me to sort out this problem

    Try to restore get a error 29 - iPhone 3GS - iFixit
    See if this helps.

  • Hi, I have recently updated my iMac from OS x mountain lion to OS X Mavericks. After that I can't upload any video and some files to my personal email account. Can anyone please help me to sort this problem.

    Hi,
    I have recently updated my iMac from OS x mountain lion to OS X Mavericks.
    After that I can't upload any video and some files to my personal email account.
    I have tried to send a small video clip to the sender as attachment. i have done this before
    with the same video same and same email account. This problem found just after installed the
    OS X Movericks. Can anyone please help me to sort this problem.
    Thanks.
    Roman

    Please follow these directions to delete the Mail "sandbox" folders. In OS X 10.9 there are two sandboxes, while in earlier versions there is only one.
    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    ~/Library/Containers/com.apple.mail
    Right-click or control-click the highlighted line and select
    Services ▹ Reveal
    from the contextual menu.* A Finder window should open with a folder named "com.apple.mail" selected. If it does, move the selected folder — not just its contents — to the Desktop. Leave the Finder window open for now.
    Log out and log back in. Launch Mail and test. If the problem is resolved, you may have to recreate some of your Mail settings. You can then delete the folder you moved and close the Finder window. If you still have the problem, quit Mail again and put the folder back where it was, overwriting the one that may have been created in its place. Repeat with this line:
    ~/Library/Containers/com.apple.MailServiceAgent
    Caution: If you change any of the contents of the sandbox, but leave the folder itself in place, Mail may crash or not launch at all. Deleting the whole sandbox will cause it to be rebuilt automatically.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combinationcommand-C. In the Finder, select
    Go ▹ Go to Folder...
    from the menu bar, paste into the box that opens (command-V). You won't see what you pasted because a line break is included. Press return.

Maybe you are looking for

  • Error while installing Oracle Applications 11i on Windows XP Home

    Hi friends, I am a functional consultant and trying to install oracle apps 11i on my home pc for learning purpose (I made a fresh install of windows for this purpose). I strictly followed the instructions given in following article: http://mhabib.wor

  • Lock Screen In MBP

    I need to know how to lock my screen on my MBP. I want to do it kind of the same way you do in windows. ctrlAlt+DelEnter. how do I do this on the Mac? Thank you, Jason.

  • Using mobile as router

    hi i'm just wondering if its possible to connect my laptop too my main pc through mobile phone. i have connected my mobile to laptop using usb cable too nokia suite (runs fine) and have a usb bluetooth dongle which is also conected to my mobile at sa

  • Could some one educate me on Automator application

    Could some one educate me on Automator application, how to start with it and how complex tasks it can handle?

  • WIA support for the Canon MX922

    Is there a WIA driver for the Canon MX922 multifunction printer? It doesn't respond to my version of Photoshop which requiresa scanner that is WIA compliant.