stl 0.6.2
stl: ^0.6.2 copied to clipboard
Supercharge Dart & Flutter with C++ STL architecture. Unlock zero-cost primitives, associative collections, memory views, and C++23 ranges.
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.