Commits

Juri Pakaste committed 0151d82

added lastValue

Comments (0)

Files changed (1)

ScalarArray/ScalarArray.h

 -(void)enumerateValuesWithBlock:(Scalar ## ct ## ArrayEnumerateBlock)block; \
 -(void)enumerateValuesUntilFalseWithBlock:(Scalar ## ct ## ArrayEnumerateUntilBlock)block; \
 -(void)insertValue:(t)value atIndex:(NSUInteger)index; \
+-(t)lastValue; \
 -(void)removeAllValues; \
 -(void)removeValueAtIndex:(NSUInteger)index; \
 -(void)removeValuesInRange:(NSRange)range; \
         count += 1; \
     } \
 } \
+-(t)lastValue { \
+    return [self valueAtIndex:count - 1]; \
+} \
 -(void)replaceValueAtIndex:(NSUInteger)index withValue:(t)value { \
     if (index >= count) \
         [NSException raise:NSRangeException format:@"index %lu not in range, count: %lu", index, count]; \