0

How to insert member function in pair of vector where one pair is member function, do I need to use std::bind to bind the member function ?

class Notification
{
  std::vector<std::pair< std::string, std::function<void(const std::string&
          , std::string)>>> NotificationReq;
public:
  Notification()
  { 
      NotificationReq.push_back(std::make_pair("NTFY_OCIS_REBOOT", TestReboot)); 
  }
  void TestReboot(const std::string& , std::string)
  {   
  }

};
int main()
{
   Notification temp;
}

I m getting compilation error: reference to non-static member function must be called. Please can some one help me out to solve this issue?? Thanks

Alok
  • 1,997
  • 2
  • 18
  • 30
  • 2
    Did you even bother attempting to solve this yourself? all I did was google your error message... seriously, don't be so lazy. – Amit Oct 12 '15 at 21:53
  • Thanks Amit . I tried but still getting the same issue. Please can you tell me what should i write for this line NotificationReq.push_back(std::make_pair("NTFY_OCIS_REBOOT", TestReboot)); – Alok Oct 13 '15 at 00:48

0 Answers0