定义const列表

Dal*_*ton 2 c++ stl

我做这样的事情并从编译器中获取错误

using namespace std;

///define a method for list
void method(const list<int>&lst) //ERROR here
{
  //do something
}
Run Code Online (Sandbox Code Playgroud)

我不知道为什么