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. quick bind1st question

quick bind1st question

Scheduled Pinned Locked Moved ATL / WTL / STL
questionhelp
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.
  • M Offline
    M Offline
    marinme
    wrote on last edited by
    #1

    I am trying to use this:

    for_each(stringname.begin(),stringname.end(),bind1st(MyFunctionName, Arg2);

    this is not passing Arg2 to MyFunctionName(Arg1, Arg2).. I am getting the following errors: error C2825: '_Fn2::second_argument_type': cannot form a qualified name error C2039: 'second_argument_type' : is not a member of 'operator``global namespace''' I can implement this easily as a functor if I make a class for it, but I thought you could use a function and just use it's name without any arguments using bind1st... am I wrong? Thx.

    M 1 Reply Last reply
    0
    • M marinme

      I am trying to use this:

      for_each(stringname.begin(),stringname.end(),bind1st(MyFunctionName, Arg2);

      this is not passing Arg2 to MyFunctionName(Arg1, Arg2).. I am getting the following errors: error C2825: '_Fn2::second_argument_type': cannot form a qualified name error C2039: 'second_argument_type' : is not a member of 'operator``global namespace''' I can implement this easily as a functor if I make a class for it, but I thought you could use a function and just use it's name without any arguments using bind1st... am I wrong? Thx.

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

      I think you need to use ptr_fun() to get a functor. Stability. What an interesting concept. -- Chris Maunder

      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