stl 0.6.6
stl: ^0.6.6 copied to clipboard
Supercharge Dart & Flutter with C++ STL architecture. Unlock zero-cost primitives, associative collections, memory views, and C++23 ranges.
0.6.6 #
Math — Comprehensive Algebraic & Calculus Expansion #
- New Feature: Implemented a comprehensive
math/symbolicmodule containingExpression,Variable, andsimplificationto build and evaluate symbolic math expressions, allowing modern intuitive usage for programmers and non-math experts. - New Feature: Implemented a
math/algebramodule featuringPolynomial,Rational, andEquationclasses. Supports exact arithmetic, equation solving, and polynomial operations. - New Feature: Implemented a
math/calculusmodule providing both numeric and symbolic differentiation and integration tools. Includes beautiful APIs likederivative()andintegrate(). - New Constants: Added advanced mathematical constants to
constant.dartand alignedRationalrepresentation. - Methodology & Design Choices:
- Numerical Integration: Implemented via Simpson's 1/3 Rule. Chosen for its superior O(h⁴) error convergence on smooth curves compared to standard Riemann or trapezoidal sums, achieving high precision with fewer iterations.
- Numerical Differentiation: Implemented via the Central Difference Method. Chosen because it provides a balanced O(h²) accuracy compared to the O(h) accuracy of simple forward/backward differences, minimizing floating-point cancellation errors.
- Symbolic Mathematics: Implemented using an Abstract Syntax Tree (AST) architecture. Chosen as it is the most robust way to process exact algebraic manipulations, recursive simplification, and symbolic derivatives without losing structural context.
0.6.5 #
Chrono — Time Expansion #
New File: chrono/calendar.dart #
Calendar types inspired by C++20 <chrono> and ISO 8601.
isLeapYear(int year) → bool— Proleptic Gregorian leap-year predicate (divisible by 4 except centuries, unless divisible by 400).daysInYear(int year) → int— Returns 365 or 366.Monthenum —january … decemberwith ISO month number (value),daysIn(year), wrappingoperator +/operator -, and afromValue(int)factory. ThrowsRangeErrorfor values outside[1, 12].Weekdayenum —monday … sundaywithisoValue(1–7),isWeekend,isWeekday, wrappingoperator +/operator -, andfromIso(int)factory.ChronoDate— Validated calendar date (year,Month, day). ThrowsRangeErrorfor invalid day-of-month (respects leap years in February). Provides:weekday,dayOfYear,isLeap,toDateTime(),toUtcDateTime(),addDays,addMonths(clamped),addYears(clamped),differenceInDays, fullComparable<ChronoDate>with</>/<=/>=,operator ==,hashCode, andtoIso8601()(YYYY-MM-DD).ChronoTime— Validated time-of-day (hour, minute, second, microsecond). Components are range-checked at construction. Provides:midnight/noonstatic getters,totalMicroseconds,toDuration(),fromDateTime,Comparable<ChronoTime>,toIso8601()(HH:MM:SS[.uuuuuu]).ChronoDateTime— Combination ofChronoDateandChronoTime.fromDateTime(DateTime),now(),nowUtc(),toDateTime(),toUtcDateTime(),toIso8601()(YYYY-MM-DDTHH:MM:SS[.uuuuuu]),Comparable<ChronoDateTime>,operator ==,hashCode.
New File: chrono/clocks.dart #
Additional clocks beyond SystemClock and SteadyClock.
Clock(abstract interface) — Common interface with a singlenow()method, enabling dependency injection of any clock implementation.MockClock implements Clock— Manually-controlled clock for deterministic testing. Time advances only throughadvance(Duration)(throwsArgumentErrorfor negative delta),set(Duration), orreset(). Time never jumps backward by accident. Analogous to the test-double pattern.HiResClock— Highest-resolution monotonic clock available (microsecond precision on native Dart). Analogous tostd::chrono::high_resolution_clock.UtcClock implements Clock— Instantiable wall-clock that always returns UTC time. Analogous tostd::chrono::utc_clock(C++20).TaiClock— International Atomic Time. TAI is ahead of UTC by a fixedtaiUtcOffsetSeconds(37 as of January 2017). Analogous tostd::chrono::tai_clock(C++20).GpsClock— GPS time, measured from the GPS epoch (1980-01-06 UTC). GPS = TAI − 19 s. Analogous tostd::chrono::gps_clock(C++20).
New File: chrono/time_interval.dart #
TimeInterval— Half-open[start, end)range ofTimePoints.- Construction:
TimeInterval(start, end)(throwsArgumentErrorifend < start) andTimeInterval.fromDuration(start, duration). - Properties:
duration,isEmpty,isNotEmpty. - Membership:
contains(TimePoint)(half-open),containsClosed(TimePoint). - Set operations:
overlaps,intersection(returnsnullwhen non-overlapping),hull(convex span),gap(returnsnullwhen touching/overlapping). operator ==,hashCode,toString.
- Construction:
New File: chrono/lap_stopwatch.dart #
LapRecord— Immutable record of a single lap:number(1-based),elapsed(total time at lap),lapTime(split duration). Value-type semantics viaconstconstructor.LapStopwatch— Enhanced stopwatch wrapping Dart'sStopwatch.- Lifecycle:
start(),stop(),reset(),isRunning,elapsed. - Laps:
lap() → LapRecord,laps(unmodifiable list),currentLapElapsed. - Statistics:
fastestLap,slowestLap,averageLap— all returnnullwhen no laps have been recorded.
- Lifecycle:
New File: chrono/timer.dart #
CountdownTimer— Synchronous countdown tracker. Records the wall-clock instant whenstart()is called and computesremaining,elapsed, andprogresson demand. No async required. ThrowsArgumentErrorfor non-positive total duration.Ticker—Stream<Duration>-based periodic tick source backed byStream.periodic. Each emitted value isinterval × tickNumber(cumulative elapsed). The stream is created lazily and reused. ThrowsArgumentErrorfor non-positive intervals.
Enhanced: chrono/chrono.dart #
TimePoint.epoch—static const TimePoint epoch = TimePoint(Duration.zero); the Unix epoch as aTimePoint.TimePoint.fromDateTime(DateTime)— Factory: creates aTimePointwhosetimeSinceEpochequalsdt.microsecondsSinceEpoch.TimePoint.toDateTime()— Converts to a UTCDateTime(inverse offromDateTime).TimePoint.toIso8601String()— Delegates totoDateTime().toIso8601String(), always producing a UTC ISO 8601 string ending inZ.ChronoIntExtension.days—Duration(days: this).ChronoIntExtension.weeks—Duration(days: this * 7).DurationExtensiononDuration— six new methods:humanReadable()— omits zero components, formats as e.g."2h 30m 5s".toIso8601()— ISO 8601 duration string, e.g."PT2H30M5S","P3D","-PT5S","PT1.5S".floor(Duration period)— floors toward negative infinity (matchesstd::chrono::floor, C++17).ceil(Duration period)— ceils toward positive infinity (matchesstd::chrono::ceil).round(Duration period)— rounds to nearest multiple, ties toward positive infinity (matchesstd::chrono::round).isPositive(getter) —trueiffinMicroseconds > 0.
Exports #
Five new exports added to stl.dart:
src/chrono/calendar.dartsrc/chrono/clocks.dartsrc/chrono/time_interval.dartsrc/chrono/lap_stopwatch.dartsrc/chrono/timer.dart
New Tests (v0.6.5 — 5 new test files) #
Added ~220 new tests across 5 new test files, raising the total suite from 1 528 to ~1 748 passing tests (0 failures, 0 skips):
| File | What is covered |
|---|---|
test/chrono_calendar_test.dart |
isLeapYear, daysInYear; Month — all 12 months, arithmetic, daysIn leap/non-leap, error handling; Weekday — ISO values, weekend/weekday, arithmetic, error handling; ChronoDate — construction, validation, computed properties, addDays, addMonths (clamping), addYears (clamping), differenceInDays, comparison operators, equality, hashCode, ISO formatting; ChronoTime — construction, validation, static getters, totalMicroseconds, toDuration, fromDateTime, comparison, ISO formatting; ChronoDateTime — construction, fromDateTime, toDateTime, comparison, equality, ISO formatting |
test/chrono_clocks_test.dart |
MockClock — initial state, advance (cumulative, zero, negative error), set, reset, Clock interface, determinism; HiResClock — monotonicity, elapsed growth; UtcClock — proximity to system time, Clock interface, monotonicity; TaiClock — TAI–UTC offset verification, constant value; GpsClock — GPS epoch sanity check, GPS < TAI ordering; TimePoint.epoch, fromDateTime/toDateTime round-trip, UTC marker |
test/chrono_interval_test.dart |
TimeInterval construction (valid, empty, inverted error); fromDuration; duration, isEmpty, isNotEmpty; contains (start/interior/end/outside); containsClosed; overlaps (overlapping, adjacent, disjoint, contained, identical); intersection (overlap, null for non-overlapping/adjacent, contained, commutativity); hull (disjoint, overlapping, identical, commutativity); gap (disjoint, null for adjacent/overlapping, commutativity); equality, hashCode, toString |
test/chrono_stopwatch_test.dart |
LapRecord field storage and toString; LapStopwatch lifecycle (isRunning, start, stop, reset, elapsed); lap recording (number sequencing, count, non-decreasing elapsed, sum of lap times, unmodifiable list, currentLapElapsed reset); statistics (fastestLap/slowestLap/averageLap null guard, single-lap identity, ordering, average in range); toString |
test/chrono_timer_test.dart |
CountdownTimer construction errors; pre-start state; post-start (isStarted, elapsed, remaining, progress range, expiry, remaining→zero, progress→1.0); reset; toString; Ticker construction errors, tick() type, stream reuse, interval values for first and second emissions; DurationExtension.humanReadable (zero, seconds, compound, days, ms, negative); toIso8601 (zero, compound, days, negative, fractional seconds, day+time); floor/ceil/round (exact, positive, negative, zero-period error); isPositive; ChronoIntExtension.days and .weeks |
New Example #
example/chrono_example.dart— End-to-end demonstration covering all 15 topics: duration literals, formatting, rounding, clocks,TimePointconversions,MockClockwith dependency injection, specialized clocks, calendar enums,ChronoDate/ChronoTime/ChronoDateTime,TimeIntervalset operations,LapStopwatchwith statistics,CountdownTimer, andTicker.
0.6.4 #
Bug Fixes #
-
Bug Fix:
StringView.lastIndexOfon empty view — CallinglastIndexOfon a zero-lengthStringViewpreviously threwInvalid argument(s): 0deep insideint.clampbecause the expression(start ?? length - 1)evaluated to-1whenlength == 0, which is belowclamp'sminargument. Fixed by adding an early-exit guard:if (length == 0) return -1. Now consistently returns-1for any pattern on an empty view, matching the documented contract. -
Bug Fix:
Divides<int>throwsTypeError—Divides<T>.callused Dart's/operator ((a as dynamic) / (b as dynamic)) which always produces adouble, even whenTisint. The subsequentas Tcast therefore threw aTypeErrorat runtime wheneverT == int. Fixed by dispatching on the type parameter: integer types now use truncating division (~/) so the result stays anint; floating-point types continue to use/. Truncation toward zero matches the behaviour of C++std::divides<int>.
Test Coverage (v0.6.4 — industrial-standard test suite) #
Added 337 new tests across 9 new extended test files, raising the total suite from 1 191 to 1 528 passing tests (0 failures, 0 skips):
| File | What is covered |
|---|---|
test/algorithm_extended_test.dart |
All 45+ algorithm functions not previously tested (allOf, anyOf, noneOf, forEach, forEachN, count, countIf, find*, search*, mismatch, fill, generate, replace, remove, swapRanges, isSorted, isSortedUntil, stableSort, nthElement, partialSort, minElement, maxElement, equal, isPermutation, lexicographicalCompare, full heap suite, isPartitioned, partitionPoint, merge, inplaceMerge, clampRange, setSymmetricDifference); plus empty-list and custom-comparator edge cases for all previously-tested functions |
test/string_view_extended_test.dart |
Bounds checking (operator[], substring, constructor); empty-string behaviour; equality & hashCode; split edge cases (empty delimiter, consecutive delimiters, leading delimiter); lastIndexOf edge cases; toUpperCase/toLowerCase; toString on slices |
test/exceptions_extended_test.dart |
toString format for all 8 concrete exception classes; empty-message contract; catchability by base type (LogicError, RuntimeError, StdException, Exception); what() mirrors message verbatim |
test/chrono_extended_test.dart |
TimePoint equality, hashCode, negative-duration subtraction, zero subtraction, compareTo, <=/>= with equal values, toString; ChronoIntExtension zero/negative helpers; SteadyClock strict monotonicity invariant |
test/ratio_extended_test.dart |
toString; mixed-sign arithmetic (crossing zero, negative×positive, divide-by-negative); comparison across signs; chain operations (1/2 + 1/3) × 6 = 5; reciprocal of reciprocal; double-negate; abs of negate |
test/functional_extended_test.dart |
Plus identity law; Multiplies zero and identity; Minus identity and self-cancellation; Divides integer quotient, double result, divide-by-zero; Modulus edge cases; Negate consistency with Minus(0,x); comparison complement relationships (EqualTo⟺NotEqualTo, Greater⟺LessEqual, Less⟺GreaterEqual); bitwise identities (BitAnd(x,~x)==0, BitOr(x,~x)==-1, BitXor(x,x)==0, BitXor(x,0)==x); De Morgan laws for LogicalAnd/LogicalOr/LogicalNot; invoke with named-only, mixed, and typed-result calls |
test/iterator_extended_test.dart |
ReverseIterator on empty list, single element, re-iteration (two passes), non-mutation of source; BackInsertIterator on empty list, close() no-op, Deque path; FrontInsertIterator empty list, close() no-op, SList pushFront path; InsertIterator prepend at 0, middle insert, close() no-op |
test/expected_extended_test.dart |
toString; monad laws (left identity, right identity, associativity — both value and error branches); same-type T==E value-vs-error inequality; valueOr; functor laws (identity, composition, error pass-through); fold branch exclusivity and return-type inference |
test/optional_extended_test.dart |
Monad laws (left identity, right identity, associativity with None short-circuit); flatMap on None never calls mapper; flatMap returning None; functor laws (identity for Some and None, composition); filter (always-true, always-false, None branch); all four zip combinations; ofNullable with non-null and null; toString (Some(x), None); hashCode for equal Some, all-None, Some-vs-None; valueOr on Some and None |
0.6.3 #
- Bug Fix: Replaced
assert(den != 0, ...)inRatio's constructor with an explicitif (den == 0) throw ArgumentError(...). The previousassertwas silently stripped in production (AOT/release) builds, allowingRatio(1, 0)to be created without error. The constructor is no longerconst; all 16 SI prefix constants (atto…exa) are nowstatic finalinstead ofstatic const. - Bug Fix: Changed
Pair.swap()from a mutatingvoid swap(Pair<T1,T2> other)that exchanged contents in-place, to a purePair<T2, T1> swap()that returns a new pair with the types and values reversed. The old signature contradicted the immutable design shared by every other utility type. Existing call sites that expected mutation will need to be updated. - New Method: Added
Expected<U, E> flatMap<U>(Expected<U, E> Function(T value) mapper)toExpected<T, E>— chains operations that themselves returnExpected, short-circuiting on the first error exactly likestd::expected::and_then(C++23). Without this, chaining required manualhasValuechecks and nesting. - New Method: Added
R fold<R>(R Function(T value) onValue, R Function(E error) onError)toExpected<T, E>— reduces anExpectedto a single value by supplying handlers for both the value and error branches. Completes the standard functor/monad API alongside the existingmapand the newflatMap. - New Feature: Added bitwise logical operators to
BitSet—operator &(AND),operator |(OR),operator ^(XOR), andoperator ~(NOT/complement). All binary operators require both operands to have the samesize(); a mismatched length throwsArgumentError.operator ~returns a newBitSetwith every bit flipped (unused high bits in the final word are masked off correctly). These were the primary missing operations for a bit-manipulation container. - New Method: Added three functional methods to
Optional<T>:R fold<R>(R Function(T) onSome, R Function() onNone)— reduces anOptionalto a single value using one of two supplied branches, the dual ofmapfor unwrapping.Optional<T> filter(bool Function(T) predicate)— returnsNonewhen the predicate returnsfalsefor aSomevalue, leavingNoneunchanged. Equivalent to Haskell'smfilter/ Java'sOptional.filter.Optional<(T, R)> zip<R>(Optional<R> other)— combines twoOptionalvalues into anOptionalof a Dart 3 record; returnsNoneif either operand isNone.
- New Method: Added five methods to
Ratio, completing its numeric API:int compareTo(Ratio other)+ operators<,<=,>,>=—Rationow implementsComparable<Ratio>. Comparison is performed on simplified canonical forms by cross-multiplying numerators to avoid floating-point error.Ratio negate()— returnsRatio(-num, den)in simplified form.Ratio reciprocal()— returnsRatio(den, num)in simplified form. ThrowsArgumentErrorifnumis zero.Ratio abs()— returns the absolute value in simplified form.
- New Method: Added five methods to
StringView, completing its read-only string API:int compareTo(StringView other)+ operators<,<=,>,>=—StringViewnow implementsComparable<StringView>. Comparison uses the same lexicographic ordering asstd::string_view::compare.int lastIndexOf(String pattern, [int? start])— reverse linear scan returning the last position ofpattern; returns-1if not found. Mirrors the existingindexOf.List<StringView> split(String delimiter)— splits the view ondelimiterand returns a list of zero-allocationStringViewsub-views into the same backing string (no newStringallocations).String toUpperCase()— returns a newStringwith all characters uppercased (delegates to the Dart runtime for correct Unicode handling).String toLowerCase()— returns a newStringwith all characters lowercased.
- New Method: Added two navigation methods to
Zipper<T>:Zipper<T> moveTo(int index)— repositions the cursor to an absolute 0-based index in O(N). ThrowsRangeErrorifindexis out of bounds. More ergonomic than callingmoveLeft/moveRightrepeatedly when the target index is known.Zipper<T>? find(bool Function(T) predicate)— scans forward from the currentfocus(inclusive) and returns a newZipperfocused on the first matching element, ornullif no match is found. Does not wrap around.
- API Fix: Changed
Any.hasValue()from a method to a getter (bool get hasValue). Every other utility with a presence check (Optional.isPresent,Expected.hasValue,Validated.isValid) exposes it as a getter;Anywas the sole inconsistency. Breaking change — call sites must drop the().
0.6.2 #
- New Feature: Added 6 Haskell-inspired functional types across three modules, expanding the library beyond C++ STL
NonEmptyList<T>(collections) — Immutable singly-linked structure mirroring Haskell'sNonEmpty a = a :| [a]. Guarantees at least one element at the type level, eliminating null-checks onfirst/last. Supportsmap,flatMap,reduce,fold,prepend,append,concat, and implementsIterable<T>.NonEmptyVector<T>(collections) — Mutable non-empty wrapper over the existingVector<T>. Preserves the non-empty invariant on everyremoveAtcall, throwingInvalidArgumentif removal would empty the container.firstandlastare always non-nullable.FingerTree<T>(collections) — Full persistent 2-3 finger tree with O(1) amortizedprepend/append, O(log n)concatandsplitAt, and O(1)lengthvia size annotations. Based on Hinze & Paterson (2006). Entirely immutable; all operations return new instances.Validated<E, A>(utilities) — Error-accumulating result type sealed intoValid<E,A>andInvalid<E,A>. UnlikeExpected<T,E>which short-circuits on the first error,Validated.zip()collects errors from both sides simultaneously, making it ideal for form/data validation pipelines. Providesmap,mapError,andThen,zip,valueOr.Zipper<T>(utilities) — Immutable cursor-based navigation over a sequence, inspired by Huet's Zipper (1997). Maintainsleft(reversed context),focus, andrightlists. All navigation (moveLeft,moveRight,replace,insert,delete) returns a newZipper<T>instance.toList()reconstructs the full sequence at any point.StateMonad<S, A>(functional) — Pure stateful computation wrapper encapsulating(A, S) Function(S). Supportsmap,flatMapfor monadic chaining, and static constructorspure,get,put, andmodifyfor common state operations.run(s)executes and returns a Dart 3 record(value, state). Useeval/execto extract only the value or only the final state.
0.6.1 #
- New Method: Added
toBigInt()to all 16 primitive types — converts the typed primitive to a [BigInt]. ForU64andUint64, uses.toUnsigned(64)to correctly reinterpret the signed bit-pattern as an unsigned value (e.g.U64(-1).toBigInt()returns18446744073709551615). - New Method: Added
static T fromBigInt(BigInt v)to all 16 primitive types — constructs a typed primitive from a [BigInt], throwing a [RangeError] if the value falls outside the type's representable range.U64.fromBigIntandUint64.fromBigIntaccept the full[0, 2^64)range and correctly handle values that straddle the signed boundary. - New Method: Added
negChecked()to all 8 signed primitive types (I8,I16,I32,I64,Int8,Int16,Int32,Int64) — returns the negated value or throws a [StateError] if this equals the type's minimum value (the only value whose negation overflows; e.g.I8(-128).negChecked()throws,I8(-127).negChecked()returnsI8(127)). Unsigned types deliberately omit this method since they have no unary negation operator. - New Method: Added
wideningMul(T other)to all 16 primitive types — multiplies two values of the same type and returns the result in the next wider type to prevent overflow. The signed chain isI8 × I8 → I16,I16 × I16 → I32,I32 × I32 → I64,I64 × I64 → BigInt; the unsigned chain mirrors it asU8 × U8 → U16, …,U64 × U64 → BigInt. The heap-allocated family follows the same chain (Int8 → Int16 → … → BigInt,Uint8 → Uint16 → … → BigInt). The 64-bit types returnBigIntsince no 128-bit primitive exists.
0.6.0 #
- Bug Fix: Fixed
Uint64.mulCheckedreturning a native Dartintmultiplication result after BigInt validation — the final return now uses the BigInt-derived value to prevent silent silent truncation discrepancies. - Bug Fix: Fixed
Uint64.addCheckedusing a signed Dartintcomparison (result < value) which fails for values near $2^{63}$; now uses the same XOR-based unsigned comparison already used by the</<=/>/>=operators. - Bug Fix: Added missing
mulCheckedtoInt64— the heap-allocated variant hadaddCheckedandsubCheckedbutmulCheckedwas entirely absent. - Missing Operator: Added unsigned right-shift
operator >>>to all heap-allocated signed variants (Int8,Int16,Int32,Int64) to match parity with the zero-cost signed types. - Missing Operator: Added unary negation
operator -()to all heap-allocated signed variants (Int8,Int16,Int32,Int64) — only the zero-cost signed types had it. - Missing Method: Added
divCheckedto all 16 primitive types — guards against division by zero and the signed-overflow edge case (I8(-128) ~/ I8(-1)wraps silently without it). - Missing Feature: Added saturating arithmetic to all 16 primitive types —
saturatingAdd,saturatingSub,saturatingMul— clamping to[min, max]instead of wrapping or throwing, matching C++ SIMD intrinsics and Rust's saturating integer API. - Missing Feature: Added C++20/23 bit-manipulation intrinsics to all 16 primitive types —
countOneBits()(popcount /std::popcount),countLeadingZeros()(std::countl_zero),countTrailingZeros()(std::countr_zero),rotateLeft(int n)/rotateRight(int n)(std::rotl/std::rotr), andbyteSwap()(std::byteswapC++23). - Missing Feature: Added cross-type conversion methods to all 16 primitive types —
toI8(),toI16(),toI32(),toI64(),toU8(),toU16(),toU32(),toU64()on the zero-cost family; andtoInt8(),toInt16(),toInt32(),toInt64(),toUint8(),toUint16(),toUint32(),toUint64()on the heap family. - Missing Utility: Added
toBinaryString()andtoHexString()to all 16 primitive types —toBinaryString()returns the value zero-padded to its type width (e.g.I8(10)→"00001010");toHexString()returns the uppercase zero-padded hex representation (e.g.I8(10)→"0A"). - Missing Constant: Added
static const int bitsto all 16 primitive types — exposes the bit-width as a first-class constant (I8.bits == 8,U32.bits == 32, etc.) enabling generic and self-documenting code. - Return-Type Bug: Overrode
abs()on all zero-cost signed types (I8,I16,I32,I64) — because theyimplements int, the inheritedabs()returnsint, not the typed primitive. Each now returns the correct narrowed type. - API Footgun: Added
I8.wrapping(int),I16.wrapping(int),I32.wrapping(int),I64.wrapping(int)(and unsigned equivalents) named constructors on all zero-cost types — the primary constructor does not truncate, soI8(200)silently holds an out-of-range value; the.wrapping()constructor applies the appropriate.toSigned(N)/.toUnsigned(N)on entry. - Inconsistency Fix: Standardised overflow error messages across all 16 types — all
addCheckederrors now read"T addition overflow",subCheckederrors read"T subtraction underflow"(unsigned) or"T subtraction overflow"(signed), andmulCheckederrors read"T multiplication overflow", eliminating the mixed"overflow/underflow"phrasing. - Inconsistency Fix: Added missing class-level API doc comments to
I32andI64; added missing operator-level doc comments toI32,I64,U8,U16,U32, andU64to bring documentation coverage to parity withI8andI16.
0.5.9 #
- New Feature: Massively expanded
geometrymodule into a full-featured computational geometry and linear algebra library, going far beyond the C++ standard to rival CGAL and GLM. The module now covers 2D shapes, 3D primitives, linear algebra, and computational geometry algorithms — the flagship non-C++ feature of the package.- Enriched 2D Primitives:
Point<T>— addedmidpointTo(),angleTo(),normalize(),cross()(2D scalar cross product $x_1 y_2 - y_1 x_2$),lerp(),operator/Triangle— addedcircumcenter,incenter,circumradius,inradius,isAcute,isRight,isObtuse,isEquilateral,isIsoceles,isScalene,angleA,angleB,angleCCircle— addedcontainsPoint(),intersectsCircle(),tangentLength(),circumferencealiasPolygon— addedisConvex,containsPoint()(ray-casting algorithm), area-weighted proper centroidRectangle— addedcontainsPoint(),intersects(),cornersgetter (all 4 vertices)
- New 2D Structures:
Ray2D— semi-infinite ray withorigin,direction,at(t),intersectSegment(),intersectCircle()Capsule— stadium/discorectangle shape via aLineSegmentspine + radius;area,perimeter,containsPoint()Arc— circular arc sector viacenter,radius,startAngle,endAngle;arcLength,chordLength,containsAngle()QuadraticBezier— degree-2 Bézier curve:evaluate(t),derivative(t),arcLength(segments),splitAt(t)CubicBezier— degree-3 Bézier curve:evaluate(t),derivative(t),arcLength(segments),splitAt(t)
- New 3D Primitives:
Point3D— full 3D vector:+,-,*,/,dot(),cross(),magnitude,normalize(),distanceTo(),lerp(),midpointTo(),angleTo()Sphere3D—center,radius,volume($\frac{4}{3}\pi r^3$),surfaceArea($4\pi r^2$),containsPoint(),intersectsSphere()Plane3D— defined bynormal+distance;distanceTo(Point3D),containsPoint(),reflect(),project()Ray3D— 3D semi-infinite ray:origin,direction,at(t),intersectSphere(),intersectPlane()Triangle3D— 3D triangle:normal,area,centroid,containsPoint()(barycentric test),toTriangle()
- New Linear Algebra:
Matrix2x2— 2×2 matrix:+,*(matrix & scalar),determinant,inverse,transpose,identity(),rotation(angle)Matrix3x3— 3×3 matrix: full arithmetic,determinant,inverse(cofactor expansion),transpose,identity(),rotationX/Y/Z(angle)Matrix4x4— 4×4 homogeneous matrix:identity(),translation(),scale(),rotationX/Y/Z(),perspective(),multiply(),transform(Point3D)Quaternion— unit quaternion for 3D rotation:*,conjugate,inverse,normalize,dot(),slerp(),fromAxisAngle(),toMatrix3x3(),toEulerAngles()
- New Computational Geometry Algorithms (
geometry_algorithms.dart):convexHull(List<Point>)— Graham scan — $O(n \log n)$closestPairOfPoints(List<Point>)— divide-and-conquer — $O(n \log n)$, returnsPair<Point, Point>segmentIntersection(LineSegment, LineSegment)— parametric intersection test, returnsPoint?pointInPolygon(Point, Polygon)— ray-casting algorithm — $O(n)$triangulate(Polygon)— ear-clipping triangulation — $O(n^2)$, returnsList<Triangle>
- Enriched 2D Primitives:
- New Example:
example/geometry_example.dart— end-to-end showcase covering 2D/3D shapes, Bézier evaluation, quaternion rotation, convex hull, ray–sphere intersection, and a full 3D matrix transform pipeline. - Documentation: Perfect API documentation coverage for all new and enriched APIs, covering every public member across all 14 new files and 5 enriched files.
0.5.8 #
- New Feature: Expanded
<ranges>module with 6 new C++20/23 range views, completing the corestd::viewssurface alongside the existing 16 range adapters. All view names and semantics follow ISO/IEC 14882:2023 and therange-v3reference implementation.IotaRange—std::views::iota: yields a lazy integer sequence[start, end]. Whenendis omitted the range is infinite. ThrowsArgumentErrorifendis less thanstart.SingleRange<T>—std::views::single: wraps exactly one value as a one-element range. Composes cleanly with every other range adapter.SplitRange<T>—std::views::split: splits an iterable on a delimiter element, yielding each segment as aList<T>. Consecutive delimiters produce empty lists; a trailing delimiter produces a final empty list.ChunkByRange<T>—std::views::chunk_by: groups consecutive elements intoList<T>chunks as long as a binary predicatepred(prev, curr)holds, breaking into a new chunk when it fails.KeysRange<K, V>—std::views::keys: extracts the key from eachPair<K, V>in an iterable, composing naturally withHashMap,SortedMap, andMultiMap.ValuesRange<K, V>—std::views::values: extracts the value from eachPair<K, V>in an iterable, the dual complement ofKeysRange.
- Documentation: Perfect API documentation coverage for all 6 new views with C++23 standard cross-references, covering every public member (class, constructor, fields, methods, and
iteratorgetter).
0.5.7 #
- New Feature: Expanded
<ranges>module with 6 new C++20/23 range views, completing the corestd::viewssurface alongside the existing 10 range adapters. All view names and semantics follow ISO/IEC 14882:2023 and therange-v3reference implementation.EnumerateRange<T>—std::views::enumerate: yields index–elementPair<int, T>tuples (0-based) for any iterable, eliminating manual counter variables.StrideRange<T>—std::views::stride: yields every Nth element of an iterable. ThrowsArgumentErroron non-positive stride.SlideRange<T>—std::views::slide: yields overlapping windows of size N asList<T>. Produces no output when the source has fewer elements than the window size.PairwiseRange<T>—std::views::pairwise/std::views::adjacent<2>: yields consecutive element pairs asPair<T, T>, the typed specialisation ofSlideRangefor N = 2.ReverseRange<T>—std::views::reverse: yields elements of any iterable in reverse order.CycleRange<T>—std::views::cycle(range-v3 / C++23 proposed): repeats an iterable indefinitely, or for an optional fixed number of full cycles. ThrowsArgumentErroron an empty source iterable.
- Documentation: Perfect API documentation coverage for all 6 new views with C++23 standard cross-references.
0.5.6 #
- New Feature: Massively expanded
<algorithm>module from 13 to 60+ functions, implementing the near-complete C++23<algorithm>standard surface. All function names and semantics follow ISO/IEC 14882:2023. New additions:- Non-modifying Sequence Operations:
allOf,anyOf,noneOf(universal/existential quantifiers);forEach,forEachN(element-wise application);count,countIf(element counting);mismatch(range divergence);find,findIf,findIfNot(element search);findEnd(last subsequence occurrence);findFirstOf(first element from a target set);adjacentFind(consecutive-duplicate search);search,searchN(subsequence and run-of-N search) - Modifying Sequence Operations:
copy,copyIf,copyN,copyBackward(copy variants);fill,fillN(range filling);transform,transformBinary(unary and binary element transformation);generate,generateN(generator-based filling);replace,replaceIf,replaceCopy,replaceCopyIf(replacement variants);remove,removeIf,removeCopy,removeCopyIf(removal and compaction);shuffle(Fisher-Yates in-place shuffle);sample(reservoir sampling — selects N random elements);swapRanges(swap two equal-length ranges) - Sorting Operations:
isSorted,isSortedUntil(sorted-order inspection);stableSort(order-preserving merge sort — $O(N \log^2 N)$);nthElement(quickselect — $O(N)$ average);partialSort(smallest-N in sorted order) - Min / Max Operations:
minElement,maxElement,minMaxElement(single-pass min, max, and both viaPair) - Comparison Operations:
equal(element-wise range equality);isPermutation(multiset equivalence check);lexicographicalCompare(three-way lexicographic ordering) - Heap Operations:
makeHeap(build max-heap in-place);pushHeap(sift-up insert);popHeap(swap-top-to-end + sift-down);sortHeap(heapsort);isHeap,isHeapUntil(heap property inspection) - Partition Utilities:
isPartitioned(partition predicate check);partitionCopy(split into two lists viaPair);partitionPoint(binary-search partition boundary — $O(\log N)$) - Additional Set Operations:
setSymmetricDifference(elements in either but not both sorted ranges) - Merge Operations:
merge(merge two sorted ranges keeping all duplicates);inplaceMerge(merge two consecutive sorted sub-ranges in-place) - Utility:
clampRange(clamps every element of a list into[low, high])
- Non-modifying Sequence Operations:
- New Example:
example/algo.dart— end-to-end showcase of algorithm + collections interplay covering search, sort, heap, partition, set ops, transform, and merge. - Documentation: Achieved perfect API documentation coverage for all 60+ functions, with C++23 standard cross-references and $O$ complexity annotations on every algorithm.
0.5.5 #
- New Feature: Massively expanded
<cmath>module from 20 to 100 functions, covering the full C++23<cmath>surface and ISO/IEC 29124 special mathematical functions. All function names and semantics follow ISO 80000-2 and IEC 60559. New additions:- Trigonometric (ISO 80000-2):
sin,cos,tan,asin,acos,atan,atan2 - Hyperbolic (ISO 80000-2):
sinh,cosh,tanh,asinh,acosh,atanh - Exponential & Logarithmic:
exp,exp2,expm1,log,log1p - Power & Root:
pow,sqrt - Rounding (IEC 60559):
floor,ceil,round,nearbyInt - Arithmetic:
abs,fdim,fmax,fmin - Floating-Point Decomposition:
remainder,scalbn,ldexp,frexp,modf,ilogb,logb - Floating-Point Classification (IEC 60559):
isNaN,isFinite,isInfinite,isNormal,signBit - Error & Gamma Functions:
erf,erfc,tgamma,lgamma - Interpolation Extras:
smootherstep,quinticStep,bilerp,pingpong,moveTowards - Angle & Signal Utilities:
wrapAngle,angleDiff,sinc,normalizedSinc - Combinatorial & Integer Math:
factorial,fallingFactorial,risingFactorial,binomial - Special Mathematical Functions (ISO/IEC 29124 / C++17):
beta,legendre,assocLegendre,hermite,laguerre,assocLaguerre,riemannZeta,sphBessel,sphNeumann,sphLegendre,cylBesselJ,cylBesselI,cylBesselK,cylNeumann,expInt,compEllint1,compEllint2,compEllint3,ellint1,ellint2,ellint3
- Trigonometric (ISO 80000-2):
- Documentation: Achieved perfect API documentation coverage for all 100 functions with ISO/C++ standard cross-references.
0.5.4 #
- New Feature: Massively expanded
<cmath>module with 20 new functions:sign,degrees,radians,fma,smoothstep,remap,saturate,step,cbrt,log2,log10,trunc,fmod,fract,copySign,nearlyEqual,square,cube,isPowerOfTwo, andnextPowerOfTwo. Full API documentation, test coverage, and example coverage for all additions. - Documentation: Achieved perfect API documentation coverage for all newly implemented functions.
0.5.3 #
- New Feature: Implemented
<chrono>module providing highly portable, C++-styleSystemClockandSteadyClockAPIs for time tracking and precise benchmarking across Native and Web platforms. - New Feature: Implemented
<ratio>module viaRatioclass providing exact rational arithmetic (num/den) and standard SI prefix constants (milli,micro,nano, etc.) for type-safe time duration computations. - New Feature: Implemented
<iterator>module introducing C++-inspired iterator adapters:ReverseIterator,InsertIterator,BackInsertIterator, andFrontInsertIteratorbridging seamlessly withVectorandDeque. - Documentation: Achieved perfect API documentation coverage for all newly implemented structures.
0.5.2 #
- New Feature: Implemented
<random>module providing a nativeStdRandomclass for C++-style random number generation. Features support for deterministic seeding (seed()), bounded integer ranges (range()), and state advancement (flush()). - Documentation: Achieved perfect 100.0% API documentation coverage (1184 out of 1184 API elements fully documented).
0.5.1 #
- New Feature: Implemented
<functional>module containing C++ standard function objects (Plus,Minus,EqualTo,LogicalAnd,BitAnd, etc.) andinvokeutility. - New Feature: Implemented
<stdexcept>module providing native Dart mapping for C++ standard exceptions (LogicError,RuntimeError,InvalidArgument,OutOfRange, etc.).
0.5.0 #
- New Feature: Expanded the
utilitiesmodule withTuple, a native adapter mimicking C++std::tuple. Seamlessly bridges heterogeneous records and collections using Dart 3. - Added missing API docs
0.4.9 #
- New Feature: Implemented
Expected<T, E>functional wrapper representing either an expected valueTor an errorE. Mimics C++23<expected>for robust error handling without exceptions. - Refactor: Renamed
utilitymodule toutilitiesto better reflect standard naming conventions across the package ecosystem.
0.4.8 #
- Technical Documentation Update: Completely redesigned the
README.mdto beautifully showcase the massive capabilities ofstlin a unified, visually categorized layout utilizing intuitive colored badges.
0.4.7 #
- Expanded the
geometrymodule with an advanced Curiously Recurring Template Pattern (CRTP) type system:Shape<T extends Shape<T>>. - Added beautiful affine transformations (
translate,scale,rotate) to all geometric shapes natively via the type system. - Enhanced
Pointwith core vector mathematics (+,-,*,magnitude,dotProduct). - Added new highly-mathematical structures:
Polygon(Shoelace formula),Ellipse(Ramanujan perimeter approximation), andLineSegment. - Redesigned
Triangleinternally to be strictly coordinate-based viaPointvertices to natively support translations and rotational space. - Fixed
pubspec.yamldescription length validation.
0.4.6 #
- Added
SortedMap<K, V>: A strictly sorted associative container mapping keys to values (equivalent to C++std::map). - Added
MultiMap<K, V>: An associative container mapping keys to multiple values while maintaining sorted key order (equivalent to C++std::multimap). - Added
SList<T>: A high-performance doubly-linked list enabling $O(1)$ bidirectional manipulations (equivalent to C++std::list). - Added
StringView: A non-owning string reference utility for zero-allocation substring and text-processing operations (equivalent to C++std::string_view). - Extensively expanded example coverage and full dartdoc api documentation.
0.4.5 #
- Implemented the
<algorithm>module, bringing powerful C++ standard algorithms to Dart iterables. - Features:
- Binary Search / Bounds:
lowerBound,upperBound,binarySearch,equalRange. - Permutations:
nextPermutation,prevPermutation. - Set Operations:
setUnion,setIntersection,setDifference. - Mutations:
rotate,reverse,unique,partition,stablePartition.
- Binary Search / Bounds:
0.4.4 #
- Implemented
MultiSetandHashMapincollectionsmodule. HashMap<K, V>: An unordered collection of key-value pairs utilizing a fast hash table under the hood (equivalent to C++std::unordered_map). Allows seamless iteration yielding<utility>Pair<K, V>instances.MultiSet<T>: An ordered collection that allows duplicate elements (equivalent to C++std::multiset). Implemented natively over an O(log N) tree structure.
0.4.3 #
- Implemented the Euclidean
geometrymodule containing fundamental 2D shapes managed via strict{required}named parameters. - Features:
Point: Exact 2D coordinate(x, y)computing Euclidean geometry intelligently.Shape: Abstract base component enforcing polymorphicareaandperimeterproperties.Circle: Evaluates pi-bound area and circumference.Rectangle: Standard rectangular dimensions logic.Triangle: Enforces Triangle Inequality Theorem natively preventing mathematically impossible geometries while solving area via Heron's Formula.
0.4.2 #
- Implemented C++
<cmath>inspired mathematical utilities viacmath.dart. - Features:
clamp: Binds a value between a lower and upper limit (C++17).lerp: Linear interpolation between two values (C++20).hypot: Computes the hypotenuse robustly without overflow or underflow (C++17).
0.4.1 #
- Comprehensive documentation coverage: Added missing API doc comments to iterables, numbers, mathematical variants, and heavily used primitive structures. Library now yields zero
public_member_api_docsanalyzer warnings, over 100 issues resolved, (98.0 %) have documentation comments
0.4.0 #
- Improved documentation across all math modules (
complex.dart,number_theory.dart,numeric.dart).
0.3.9 #
-
Implement C++
-
Features:
- accumulate: Sums up / folds elements.
- reduce: Similar to accumulate, but with potentially different semantics (parallelizable if ever needed, or just standard fold).
- inner_product: Computes the inner product (dot product) of two ranges.
- adjacent_difference: Computes the differences between adjacent elements.
- partial_sum: Computes the prefix sums.
- iota: Fills a range with successively increasing values.
-
A complete, high-performance C++-style Complex number class.
- Features:
- Real and imaginary parts (real(), imag()).
- Arithmetic operator overloading (+, -, *, /).
- Complex functions: abs() (magnitude), arg() (phase), conj() (conjugate), norm() (squared magnitude).
- Polar representation constructors.
- Features:
-
Description: Common number theory algorithms.
- Features:
- gcd: Greatest Common Divisor (highly optimized).
- lcm: Least Common Multiple.
- midpoint: Find midpoint (a + b)/2 safely without overflow.
- is_prime: Check if a number is prime.
- prime_factorization: Get the prime factors of a number.
- Features:
0.3.8 #
- Created
lib/src/math/constant/constant.dartwith 26 constants across these groups, all named per ISO 80000-2 conventions
0.3.7 #
- Added small improvement to already existing features and increase documentation
- No need feature- improve examples
0.3.6 #
- Renamed primitive type wrappers (
i8,i16,i32,i64,u8,u16,u32,u64) to their capitalized equivalents (I8,I16,I32,I64,U8,U16,U32,U64) to align with Dart conventions. - Added
Int8,Int16,Int32,Int64,Uint8,Uint16,Uint32, andUint64structured explicitly arounddart:typed_data. These variants guarantee deep C++ matching arithmetic wrapping natively via memory boundaries, flawlessly bridging stable 64-bit precision boundaries correctly across Javascript/Web targets dynamically.
0.3.5 #
- Implemented
i8zero-cost primitive type extension with auto-wrapping arithmetic and checked bounds. - Implemented
i16zero-cost primitive type extension with auto-wrapping arithmetic and checked bounds. - Implemented
i32zero-cost primitive type extension with auto-wrapping arithmetic and checked bounds. - Implemented
i64zero-cost primitive type extension with auto-wrapping arithmetic, checked bounds, and strict two's complement sign management. - Implemented
u8zero-cost unsigned primitive type extension. - Implemented
u16zero-cost unsigned primitive type extension. - Implemented
u32zero-cost unsigned primitive type extension. - Implemented
u64zero-cost unsigned primitive type extension utilizing native bitwise overrides and BigInt scaling for deep divisions.
0.3.4 #
- Make improvement to the
NumberLineclass. - Added
operator ==andhashCodetoNumberLineclass. - Added
toString()toNumberLineclass. - Added
reset()method toNumberLineclass. - Added
empty()method toNumberLineclass. - Added
hasValue()method toNumberLineclass. - Added
type()method toNumberLineclass. - Added
cast<T>()method toNumberLineclass. - Added
set()method toNumberLineclass. - Added
get()method toNumberLineclass. - Added
operator []toNumberLineclass. - Added
operator []=toNumberLineclass. - Added
operator +toNumberLineclass. - Added
operator -toNumberLineclass. - Added
operator *toNumberLineclass. - Added
operator /toNumberLineclass. - Added
operator %toNumberLineclass. - Added
operator <toNumberLineclass. - Added
operator >toNumberLineclass. - Added
operator <=toNumberLineclass. - Added
operator >=toNumberLineclass.
0.3.3 #
- Added TakeRange (std::views::take)
- Added DropRange (std::views::drop)
- Added FilterRange (std::views::filter)
- Added TransformRange (std::views::transform)
- Added JoinRange (std::views::join)
- Added documentation to all the range classes.
- Added documentation to the ranges.
0.3.2 #
- Fix upload issue to-RELATED to project
- applied the @override annotation to the operator + method in array.dart
- Other minor fixes related to dart analyzer test
0.3.1 #
- Added
operator ==andhashCodetoAnyclass. - Added
toString()toAnyclass. - Added
reset()method toAnyclass. - Added
empty()method toAnyclass. - Added
hasValue()method toAnyclass. - Added
type()method toAnyclass. - Added
cast<T>()method toAnyclass. - Added
set()method toAnyclass. - Added
get()method toAnyclass. - Added
operator []toAnyclass. - Added
operator []=toAnyclass. - Added
operator +toAnyclass. - Added
operator -toAnyclass. - Added
operator *toAnyclass. - Added
operator /toAnyclass. - Added
operator %toAnyclass. - Added
operator <toAnyclass. - Added
operator >toAnyclass. - Added
operator <=toAnyclass. - Added
operator >=toAnyclass. - Added
operator ==toArrayclass. - Added
operator !=toArrayclass. - Added
operator +toArrayclass. - Added
operator -toArrayclass. - Added
operator *toArrayclass. - Added
operator /toArrayclass. - Added
operator %toArrayclass. - Added
operator <toArrayclass. - Added
operator >toArrayclass. - Added
operator <=toArrayclass. - Added
operator >=toArrayclass.
0.3.0 #
- Added
Array<T>: A strict, fixed-size contiguous collection conceptually mapping directly to C++std::array. All expanding/shrinking mutations fiercely throw errors. Integrates extremely well using overloadsoperator +andoperator ==logically against dynamic iterables without altering boundaries natively.
0.2.9 #
- Added
BitSet: A space-efficient set implementation for managing boolean flags. - Added
Var<T>: A mutable variable wrapper for holding and updating values. - Added
Variant<T1, T2, ...>: A type-safe discriminated union (sum type) that can hold values of multiple different types. - Added
Ref<T>: A mutable reference wrapper for holding and updating values. - Added
Box<T>: A mutable reference wrapper for holding and updating values. - Added
Any: A type-safe wrapper for holding values of any type.
0.2.8 #
- Added
Optional<T>: A functional wrapper representing possibly-absent values with methods likevalueOrandmap.
0.2.7 #
- Turn the stl_example.dart into a massive "Table of Contents" or complete showcase file. Import everything.
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>.
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.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.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.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.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.1.9 #
- Updated
Readme.md - Added test for
ForwardListcollection.
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.7 #
- Added
Dequeexample showcase.
0.1.6 #
- Added
Dequecollection.
0.1.5 #
- Cleaned up duplicate
vector.dartsource file.
0.1.4 #
- Added
stl.collectionsfor more collection types. - Moved
Vectortostl.collections. - Removed
stl_base.dart.
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.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.1 #
- Documentation update: Fixed installation instructions in README.
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.0.1 #
- Initial release and project structure.
- Reserving the
stlpackage name.