Modify operator[] to get the right LastResult
authordahyeong.kim <dahyeong.kim@samsung.com>
Thu, 26 Sep 2013 07:07:07 +0000 (16:07 +0900)
committerdahyeong.kim <dahyeong.kim@samsung.com>
Thu, 26 Sep 2013 07:08:16 +0000 (16:08 +0900)
Change-Id: Icb76f32f88e1080680e06910f734a5a7843a0ab4
Signed-off-by: dahyeong.kim <dahyeong.kim@samsung.com>
inc/FBaseColRandomIteratorT.h

index 49cb2e4..8d95793 100644 (file)
@@ -397,7 +397,8 @@ public:
        reference operator [](difference_type index)
        {
                ClearLastResult();
-               TryReturnResult(__index + index >= 0 && __index + index < __pList->GetCount(), **this, E_OUT_OF_RANGE, "[%s] It is out of range.", GetErrorMessage(E_OUT_OF_RANGE));
+               reference r = reinterpret_cast< T& >(__pList->GetAtRef(__index));
+               TryReturnResult(__index + index >= 0 && __index + index < __pList->GetCount(), r, E_OUT_OF_RANGE, "[%s] It is out of range.", GetErrorMessage(E_OUT_OF_RANGE));
                return reinterpret_cast< T& >(__pList->GetAtRef(__index + index));
        }