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. ATL / WTL / STL
  4. bind2nd with mem_fun_ref

bind2nd with mem_fun_ref

Scheduled Pinned Locked Moved ATL / WTL / STL
c++questionlearning
3 Posts 3 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.
  • B Offline
    B Offline
    babouin
    wrote on last edited by
    #1

    // call member function printWithPrefix() for each element // - "person: " is passed as an argument to the member function for_each (coll.begin(), coll.end(), bind2nd((mem_fun_ref(&Person::printWithPrefix)), "person: ")); this code from a book, dont compile on vc++. I am disapointed. Please. What to do ? Vincent

    M C 2 Replies Last reply
    0
    • B babouin

      // call member function printWithPrefix() for each element // - "person: " is passed as an argument to the member function for_each (coll.begin(), coll.end(), bind2nd((mem_fun_ref(&Person::printWithPrefix)), "person: ")); this code from a book, dont compile on vc++. I am disapointed. Please. What to do ? Vincent

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      I'm guessing that you're using Visual C++ 6.0. This version doesn't support a lot of the Standard C++ Library. I recommend that you either use a later version of Visual Studio or download the Visual C++ Toolkit 2003[^], which includes the compiler tools from VS.NET 2003. Stability. What an interesting concept. -- Chris Maunder

      1 Reply Last reply
      0
      • B babouin

        // call member function printWithPrefix() for each element // - "person: " is passed as an argument to the member function for_each (coll.begin(), coll.end(), bind2nd((mem_fun_ref(&Person::printWithPrefix)), "person: ")); this code from a book, dont compile on vc++. I am disapointed. Please. What to do ? Vincent

        C Offline
        C Offline
        Christof Schardt
        wrote on last edited by
        #3

        I had the same and searched the error without success. Recently I got VC7.1, I tried it again and it compiled perfectly! So change your compiler or dont't use mem_fun_ref. Christof

        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