Thread: error C2064: term does not evaluate to a function taking 2 arguments

  1. #1
    Registered User
    Join Date
    May 2015
    Posts
    2

    error C2064: term does not evaluate to a function taking 2 arguments

    Hi guys. I'm getting this error


    Error 5 error C2064: term does not evaluate to a function taking 2 arguments C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xrefwrap 431 1




    after trying to do this


    Code:
    typedef std::function<int(int, int)> op;
    
    
    op someOperator = std::plus<int>();
    op someOtherOperator = std::minus<int>();

    so I can call a function like


    Code:
    UpdateValues(int X, int Y, op One, op Two)
    {
          //eventually doing something like
          One(X, someOtherInt);
          Two(Y, someOtherInt);
    }

    What is going on?


    Here is a link to my files if you need them https://www.dropbox.com/s/vn2akcyb9f...ckers.rar?dl=0
    Last edited by ZeHgS; 05-24-2015 at 09:42 AM.

  2. #2
    Registered User
    Join Date
    May 2015
    Posts
    2
    UPDATE (Couldn't edit post): In the end there were three separate things that kept generating that error:


    I was passing an op object in place of a bool parameter
    I was passing an op* object in place of an op parameter
    I was passing an op object in place of an op* paramater

  3. #3
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,876
    Fact - Beethoven wrote his first symphony in C

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 08-24-2011, 10:26 AM
  2. Replies: 1
    Last Post: 06-14-2010, 01:27 PM
  3. Replies: 1
    Last Post: 06-14-2010, 01:26 PM
  4. Replies: 4
    Last Post: 10-25-2009, 05:06 PM
  5. Replies: 9
    Last Post: 10-20-2008, 10:23 AM