summaryrefslogtreecommitdiff
path: root/Menes/radixSortWithSelector.mm
diff options
context:
space:
mode:
Diffstat (limited to 'Menes/radixSortWithSelector.mm')
-rw-r--r--Menes/radixSortWithSelector.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/Menes/radixSortWithSelector.mm b/Menes/radixSortWithSelector.mm
index 949a14b..f61dd99 100644
--- a/Menes/radixSortWithSelector.mm
+++ b/Menes/radixSortWithSelector.mm
@@ -41,6 +41,8 @@
#include "Menes/radixSortWithSelector.h"
+#include <objc/runtime.h>
+
struct RadixItem_ {
size_t index;
uint32_t key;
@@ -109,4 +111,12 @@ struct RadixItem_ {
delete [] swap;
}
+- (void) radixSortUsingSelector:(SEL)selector {
+ if ([self count] == 0)
+ return;
+
+ IMP imp(class_getMethodImplementation([[self lastObject] class], selector));
+ [self radixSortUsingFunction:reinterpret_cast<MenesRadixSortFunction>(imp) withContext:selector];
+}
+
@end