게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
c++ 오류 질문 드려요~
게시물ID : programmer_10234짧은주소 복사하기
작성자 : 자이제
추천 : 0
조회수 : 917회
댓글수 : 8개
등록시간 : 2015/05/19 14:56:00
옵션
  • 본인삭제금지
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
 
class MutaliskEasy{
public:
    bool Pred(int x){
        return x <= 0;
    }
 
    int minimalAttacks(vector <int> x){
        int attack_count = 0;
        vector<int>::iterator iter1;
        vector<int>::iterator iter2;
        vector<int>::iterator iter3;
 
        while (x.size() != 0)
        {
            if (x.size() == 3){
                for (iter2 = x.begin(); iter2 != max_element(x.begin(), x.end()) || iter2 != min_element(x.begin(), x.end()); iter2++);
                iter1 = max_element(x.begin(), x.end());
                iter3 = min_element(x.begin(), x.end());
 
                *iter1 -= 9;
                *iter2 -= 3;
                *iter3 -= 1;
 
                attack_count++;
            }
            else if (x.size() == 2){
                iter1 = max_element(x.begin(), x.end());
                iter2 = min_element(x.begin(), x.end());
 
                *iter1 -= 9;
                *iter2 -= 3;
                
                attack_count++;
            }
            else{
                iter1 = x.begin();
 
                *iter1 -= 9;
 
                attack_count++;
            }
            
            remove_if(x.begin(), x.end(), Pred);
        }
 
        return attack_count;
    }
};
cs

48번 줄 remove_if함수에서 오류 error C3867: 'MutaliskEasy::Pred': 함수 호출에 인수 목록이 없습니다. '&MutaliskEasy::Pred'을(를) 사용하여 멤버에 대한 포인터를 만드십시오.

와 같은 오류가 발생합니다.

저 오류에 대해 구글 검색도 하고 스택오버플로우에도 찾아봤는데 이 함수에서는 어떻게 해결할지 모르겠어서 질문드려요 ㅠㅠ
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호