|
진수.네모 님이 쓰신 글 :
: using namespace std;
:
: struct RandomFunction {
: RandomFunction() { randomize(); }
: int operator() (int X) { return random(X); }
: };
:
: // vector<int> index;
: index.clear();
: index.resize(count);
: std::iota(index.begin(), index.end(), 0);
:
: // std::random_shuffle(index.begin(),index.end());
: std::random_shuffle(index.begin(),index.end(),RandomFunction());
:
: 이렇게 했습니다. 헌데 다음과 같은 에러가 발생합니다.
: [C++ Error] typingword.cpp(127): E2285 Could not find a match for 'random_shuffle<_RandomAccessIter,_RandomNumberGenerator>(int *,int *,RandomFunction)'
:
: 원인을 찾지 못해서 질문합니다.
: 좋은 하루되세요.
RandomFunction rf;
std::random_shuffle(index.begin(),index.end(),rf);
|