stl 0.2.6
stl: ^0.2.6 copied to clipboard
A performance-oriented implementation of STL patterns (Vector, List, algorithms) for Dart.
0.0.1 #
- Initial release and project structure.
- Reserving the
stlpackage name.
0.1.0 #
Added #
- Introduced the core
Vector<T>class. - Overloaded
operator ==andhashCodefor deep value-based equality matching instead of default reference equality. - Implemented C++ STL-style lexicographical comparison operators (
<,<=,>,>=) andcompareToby enforcingT extends Comparable. - Re-added random element access (
operator []andoperator []=) with strict memory safety and bounds checking. - Overridden
toString()for beautifully formatted array-like console output. - Implemented core container modifiers (
push_back,pop_back,clear,insert) with underlying bounds validation. - Made the
Vectorcompletely compatible with Dart standard iterables by introducingIterableMixin, granting dozens of built-in loop operations (.map,.where,reduce,for-inblocks).
Changed #
- Completely rewrote
Vector<T>to establish a clean slate and focus on strictconstandfinallist initialization semantics. - Temporarily removed all extended operations (
+,-,*,at(),toList(), etc.) for architectural redesign.
0.1.1 #
- Documentation update: Fixed installation instructions in README.
0.1.2 #
Added #
- Added
operator +for vector concatenation. - Added
operator *for vector multiplication with an integer. - Added
operator -for vector subtraction. - Added
~for conversion to List.
0.1.3 #
- Added
at()method for safe random access with bounds checking. - Added
front()method for accessing the first element with bounds checking. - Added
back()method for accessing the last element with bounds checking. - Added
empty()method for checking if the vector is empty. - Added
size()method for getting the size of the vector. - Added
sort()method for sorting the vector. - Added
reverse()method for reversing the vector. - Added
shuffle()method for shuffling the vector. - Added
contains()method for checking if the vector contains an element. - Added
indexOf()method for getting the index of an element. - Added
remove()method for removing an element. - Added
removeAt()method for removing an element at a specific index. - Added
removeLast()method for removing the last element. - Added
removeRange()method for removing a range of elements. - Added
removeWhere()method for removing elements that satisfy a condition. - Added
retainWhere()method for retaining elements that satisfy a condition.
0.1.4 #
- Added
stl.collectionsfor more collection types. - Moved
Vectortostl.collections. - Removed
stl_base.dart.
0.1.5 #
- Cleaned up duplicate
vector.dartsource file.
0.1.6 #
- Added
Dequecollection.
0.1.7 #
- Added
Dequeexample showcase.
0.1.8 #
- Added
Stackcollection. - Added unit tests for
Stackcollection. - Added unit test for
Vectorcollection. - Added unit test for
Dequecollection. - Removed
stl_test.dart. - Added
ForwardListcollection.
0.1.9 #
- Updated
Readme.md - Added test for
ForwardListcollection.
0.2.0 #
Added #
- Expanded
Vector<T>with strictly identical C++ style operations:assign(),resize(),insertAll(), andswap(). - Enhanced
Deque<T>by natively mixing inIterableMixin<T>, enabling dozens of standard iterable operations. - Appended missing C++ aliases to
Deque<T>(push_back(),push_front(),pop_back(),pop_front(),front(),back()). - Added index-based random access array functionality (
operator [],operator []=,at()) andswap()method toDeque<T>. - Greatly expanded
ForwardList<T>singly-linked manipulation algorithms:remove(),remove_if(),insert_after(),erase_after(), andunique(). - Implemented state
swap()adapter forStack<T>.
0.2.1 #
Added #
- Created new
rangessub-module for generating standard ranges. - Implemented
NumberLine<T extends num>to cleanly mimic iterable sequences of numbers with customizedstart,end, andstepproperties. NumberLinesupports generic types, making it easy to generate ranges of bothintanddoubleseamlessly.- Mixed in
IterableBase<T>givingNumberLineout-of-the-box support forfor-inblocks and list extensions like.map,.reduceand.where.
0.2.2 #
Changed #
- Major API Refactor: Transitioned all C++ STL style
snake_casemethod and property names (e.g.,push_back,remove_if) to standard DartlowerCamelCase(pushBack,removeIf) to seamlessly integrate with Dart's tooling, ecosystem, and linter rules, enabling a perfect 160/160 pub.dev score. - Mixed in
IterableMixin<T>intoStack<T>, allowing deep iteration from top-to-bottom without consuming the stack elements. - Updated
Stack<T>.pop()to return the removed element instead ofvoid, providing a significantly improved and Dart-idiomatic developer experience. - Implemented value-based deep equality (
operator ==andhashCode) forStack<T>, enabling strict state comparisons. - Inherited and verified standard search utilities (
contains,elementAt, etc.) forStack<T>via Iterable mixins natively. - Developed
Pair<T1, T2>(mimicking C++<utility>std::pair) to cleanly store and exchange heterogeneous objects as a single unit, complete with deep equality checks and a lovelymakePairglobal function helper. - Added Dart 3 Record interoperability to
Pair<T1, T2>via.recorddestructuring property andPair.fromRecord()constructor. - Added seamless Map translations (
Pair.fromMapEntryandtoMapEntry()) to bridge<utility>pairs flawlessly with standard Dart Maps. - Implemented
ComparablePairextension, magically unlockingstd::pairlexicographical comparison operators (<,>,<=,>=) only when type-safe. - Added utility converters
.toList()and deep.clone()behavior toPair.
0.2.3 #
Changed #
- Major documentation optimization: the API
README.mdhas been completely revitalized to document the newcamelCaseinfrastructure, properly highlight the newStackmodifiers, and beautifully showcasePair<T1, T2>.
0.2.4 #
- Added ZipRange - Mimics C++23
std::views::zip. - Added ChunkRange - Mimics C++23
std::views::chunk. - Added RepeatRange - Mimics C++23
std::views::repeat. - Added CartesianRange - Mimics C++23
std::views::cartesian_product. - updated README.md
- Removed unnecessary_non_null_assertion
0.2.6 #
- Added Queue
- Added PriorityQueue
- Added Set
- Added HashSet
- Added SortedSet
- Standardized deep-value equality matching (
operator ==andhashCode) universally across older containers (Deque,PriorityQueue,ForwardList). - Overridden
toString()reliably for all non-compliant collections to drastically improve console debugging experience and format. - Added missing
swap()API specifically toForwardList<T>.