在 linux 平台只有 at(n) 会抛出 std::out_of_range 异常,而其他两个都不会。
try
{
//cpu.at(10)=
cout<<cpu.at(2)<<endl;
}
catch(cpu.out_of_range e)
{
cout<<e.what()<<endl;
}
在 linux 平台只有 at(n) 会抛出 std::out_of_range 异常,而其他两个都不会。
try
{
//cpu.at(10)=
cout<<cpu.at(2)<<endl;
}
catch(cpu.out_of_range e)
{
cout<<e.what()<<endl;
}