C++ ArrayList / JS Arrays (in one header file only)

1
2
/**Requirements:
*@arg typeT must be either a class (ex: 'class Car' leads to 'ArrayList<Car>'), an enumerated type (ex: 'struct Car' leads to 'ArrayList<Car>') or a
    standard type(ex: 'int' leads to 'ArrayList<int>')
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
OPERATIONAL

My C++ implementation of a mix of Java's ArrayList and Javascript's arrays !

EDITS:
16 : added a "how to use" to newFromArrayPointer
17 : small bug fixes, unit tested everything (except indexOf and lastIndexOf that fails for seemingly no reason)
18 : added filter and forEach (functionnal), indexOf lastIndexOf forEach (and probably filter) are broken for now
19 : added filterOut (functionnal), above are still broken
20 : corrected some return types, above are still broken
21 : corrected all bad return types, fixed assignment operator, made resizable non-const (should not be modified for consistency's sake), fixed indexOf, fixed lastIndexOf, fixed forEach, fixed filter, fixed filterOut, added and fixed selfFilter, added and fixed selfFilterOut. Passed all 37 unit test cases, is considered operational from now on, all edits will be for adding methods
22 : removed swap (useless now, was a stupid hotfix)
23 : corrected typos and remove
24: corrected some return types, added sort (std::sort specialization)
25: corrected typos and comments, added qsort (std::qsort specialization) and Small Utilities and Aliases
26: added explicit call to destructor at the beginning of each constructor to avoid memory leaks
27: optimized code a bit
28: doxygen ready + small bug fixes

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.