Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. Why calling sort() crashes?

Why calling sort() crashes?

Scheduled Pinned Locked Moved Managed C++/CLI
graphicshelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kumar Anitesh
    wrote on last edited by
    #1

    Could anyone please help me to find why call to sort() is crashing at run-time in following code block:

    string s = "Annnitttesrrh.";
    vector vecChar(s.begin(), s.end());
    sort(vecChar.begin(), vecChar.end(), greater_equal());

    Am i missing something very basic ?

    L 1 Reply Last reply
    0
    • K Kumar Anitesh

      Could anyone please help me to find why call to sort() is crashing at run-time in following code block:

      string s = "Annnitttesrrh.";
      vector vecChar(s.begin(), s.end());
      sort(vecChar.begin(), vecChar.end(), greater_equal());

      Am i missing something very basic ?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Kumar Anitesh wrote:

      Am i missing something very basic ?

      Not that I can figure out. I tried the same code, but using greater as the predicate and it works fine. This needs an STL expert to look at it, but you posted in the managed C++ forum; try http://www.codeproject.com/Forums/4486/ATL-WTL-STL.aspx[^].

      Veni, vidi, abiit domum

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups