CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 30

Threaded View

  1. #24
    Join Date
    Apr 2007
    Location
    Mars NASA Station
    Posts
    1,436

    Re: Functor Tutorial

    Amleto has answers my question.

    I made a mistake, the bind1st and bind2nd only accepts binary functor where my member function is a unary functor and the find_if.

    I switch to boost now.

    Code:
    folderIconVecIte myIte 
      = find_if(iconPool.begin(), iconPool.end(), 
       boost::bind(
        boost::mem_fn(&folderIcon::IsExistFolderIconType),     
         _1, folderIconType)  );
    
    Compile OK 
    
    folderIconVecIte myIte 
      = find_if(iconPool.begin(), iconPool.end(), 
       boost::bind(
        boost::mem_fn(&folderIcon::IsExistFolderIconType),     
         _1)(folderIconType)  );
    
    Compile Error - 2
    Why the second one has compile error since i follow the bind documentation ?

    Solve.
    Last edited by Peter_APIIT; June 4th, 2010 at 02:19 AM.
    Thanks for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured