나는 이러한 방법으로, 표준 : : 찾기 기능을 오버로드 시도 :과부하 : 찾기 기능
include <list>
include <string>
include "Marker.h"
namespace Test {
class MarkerContainer {
private:
std::list<Marker*> list;
double end_t;
inline bool exists(std::list<Marker*> *input_list, Marker* check);
public:
MarkerContainer();
MarkerContainer(double end_time);
bool addMarker(Marker* input);
double computeBeatTime(double sample_t);
double computeSampleTime(double beat_t);
void printAll();
};
}
std::list<Ableton::Marker*>::iterator std::find(std::list<Ableton::Marker*>::iterator first, std::list<Ableton::Marker*>::iterator last, Ableton::Marker* value){
for (;first!=last; first++) if (**first==*value) break;
return first;
}
하지만이 컴파일러 오류 잡기 : 나는 어떤을했다 희망
Out-of-line definition of 'find' does not match any declaration in namespace 'std' in /Users/.../MarkerContainer.h
을 어리석은 실수와 내가하고 싶은 것은 간단하다. 어떤 생각?
미리 감사드립니다. 피에트로
C++ 표준은'std'에서 함수를 만들 수 허용하지 않습니다 네임 스페이스. –
@OliCharlesworth : 일반적으로 네,하지만 당신은 전문화 할 수 있습니다. (이 Q가 전문적이지는 않습니다) –