C++ #include #include int main() { std::list lst; lst.push_back(5); lst.push_back(1); std::sort(lst.begin(), lst.end()); return 0; } 당연하다는 듯이 이런 코드를 작성한 적이 있는데 sort 부분에서 에러가 뜬다. 이유는 아래와 같다. template void sort( RandomIt first, RandomIt last ); RandomIt must meet the requirements of ValueSwappable and LegacyRandomAccessIterator. std::sort 함수의 매개변수로 오는 반복자는 반드시 RandomAccessIterator 타입이어야 한다. 벡터는 반복..