changed Struct<int> operator[] index to int

This commit is contained in:
Aleksandar Fabijanic 2008-11-30 04:06:10 +00:00
parent 905534af1c
commit c617bbe551
2 changed files with 4 additions and 4 deletions

View File

@ -530,12 +530,12 @@ public:
return false;
}
Var& operator [] (std::size_t name)
Var& operator [] (int name)
{
return _val[name];
}
const Var& operator [] (std::size_t name) const
const Var& operator [] (int name) const
{
return _val[name];
}

View File

@ -436,7 +436,7 @@ public:
InvalidAccessException>("Not an array.")->operator[](n);
else if (isStruct())
return structIndexOperator(holderImpl<Struct<int>,
InvalidAccessException>("Not a struct."), n);
InvalidAccessException>("Not a struct."), static_cast<int>(n));
else
throw InvalidAccessException("Must be struct or array.");
}
@ -451,7 +451,7 @@ public:
InvalidAccessException>("Not an array.")->operator[](n);
else if (isStruct())
return structIndexOperator(holderImpl<Struct<int>,
InvalidAccessException>("Not a struct."), n);
InvalidAccessException>("Not a struct."), static_cast<int>(n));
else
throw InvalidAccessException("Must be struct or array.");
}