mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-25 02:06:04 +02:00
++ and -- operators for DynamicAny
This commit is contained in:
@@ -209,6 +209,43 @@ DynamicAny& DynamicAny::operator /= (const DynamicAny& other)
|
||||
}
|
||||
|
||||
|
||||
DynamicAny& DynamicAny::operator ++ ()
|
||||
{
|
||||
if (!isInteger())
|
||||
throw InvalidArgumentException("Invalid operation for this data type.");
|
||||
|
||||
return *this = *this + 1;
|
||||
}
|
||||
|
||||
DynamicAny DynamicAny::operator ++ (int)
|
||||
{
|
||||
if (!isInteger())
|
||||
throw InvalidArgumentException("Invalid operation for this data type.");
|
||||
|
||||
DynamicAny tmp(*this);
|
||||
*this += 1;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
DynamicAny& DynamicAny::operator -- ()
|
||||
{
|
||||
if (!isInteger())
|
||||
throw InvalidArgumentException("Invalid operation for this data type.");
|
||||
|
||||
return *this = *this - 1;
|
||||
}
|
||||
|
||||
DynamicAny DynamicAny::operator -- (int)
|
||||
{
|
||||
if (!isInteger())
|
||||
throw InvalidArgumentException("Invalid operation for this data type.");
|
||||
|
||||
DynamicAny tmp(*this);
|
||||
*this -= 1;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
DynamicAny& DynamicAny::operator [] (std::vector<DynamicAny>::size_type n)
|
||||
{
|
||||
DynamicAnyHolderImpl<std::vector<DynamicAny> >* pHolder = dynamic_cast<DynamicAnyHolderImpl<std::vector<DynamicAny> > *>(_pHolder);
|
||||
|
||||
Reference in New Issue
Block a user