Question: error: reference to non-static member function must be called Here is my code: #include #include #include using namespace std; class Solution { public : Solution(vector

error: reference to non-static member function must be

called

Here is my code:

#include  #include  #include  using namespace std; class Solution { public: Solution(vectorint,int>>); vectorint,int>> rallies; vectorint,int>> outputRallies(); bool strict_weak_ordering(pair<int,int>,pair<int,int>); }; Solution::Solution(vectorint,int>> _rallies) { rallies = _rallies; } bool Solution::strict_weak_ordering(pair<int, int> a,pair<int, int> b) { return a.second < b.second; } vectorint,int>> Solution::outputRallies() { std::vectorint,int>> schedule; unordered_map<int,int> hash; for(auto i = 0;i < rallies.size();i++){ hash.insert(make_pair(rallies[i].second,i)); } sort(rallies.begin(),rallies.end(),strict_weak_ordering);// <-- Reference to non static member function must be called 

 int x=0; for(auto j = 0;jint,int>::const_iterator got = hash.find(rallies[j].second); schedule.push_back(make_pair(got->second,x)); x += rallies[j].first; } return schedule; } I dont know what is worry with it,please help 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!