link http://hyunity3d.tistory.com/244?category=527936 코드 돌려보고 c++11 형태로 문법오류 수정해서 동작 처리 #include <iostream> #include <list> #include <functional> // std::unary_function // 20 이상 30 미만이면 true template <typename T> class Is_Over20_Under30 : public std::unary_function<T, bool> // argument type - T, result type - bool { public: bool operator( ) (T& val) { return (val >= 20 && val < 30); } }; // 함수 객체 정의 template <typename T> struct COMPARE_ITEM { bool operator()(const T l, const T r) const { // 정렬 시에는 올림 차순으로된다. 내림 차순으로 하고 싶으면 < 에서 > 로 변경하면 된다. return l < r; } }; int test8() { std::list< int > list1; list1.push_back(10); list1.push_back(20); list1.push_back(25); list1.push_back(30); list1.push_back(34); std::cout << std::endl << "remove_if 테스트 1 - 사용자가 정의한 조건에 의해 삭제" << std::endl; // 20 이상 30 미만은 삭제한다. list1.remove_if(I...
alexnetster@gmail.com/ 나중에 재사용시 흔적을 남겨 찾기 쉽게 하는 것이 목적/ 최대한 간단하게.