【发布时间】:2013-12-13 06:00:23
【问题描述】:
我在分析以下代码时遇到问题:
for (int argI = 1; argI < args_.size(); ++argI) //size(): Return the number of
{ //arguments.
argListString += ' '; //Space into string
argListString += args_[argI]; //new argument into string
if (args_[argI][0] == '-') // ????
{
const char *optionName = &args_[argI][1]; //????
我的问题是标有???? 的行。当我查找对象args_ 时,它是stringList 类型,而stringList 是List<T> 的模板类。 List<T> 定义为
Template<class T>
class Foam::List< T >
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bounds checking, etc. Storage is allocated on free-store during
construction.
如果args_ 是一维数组,为什么在第 415 行和第 417 行像二维数组一样访问它?
问候 直线
【问题讨论】: