[stdlib] Add take_items() method to List by dl-alexandre · Pull Request #6326 · modular/modular
BEGIN_PUBLIC [stdlib] Add take_items() method to List This adds a take_items() method to List that returns an iterator draining the list by moving elements out. Similar to Dict.take_items(), this allows efficient transfer of elements without copying. Changes: - Added _ListTakeIter struct that moves elements using take_pointee() - Added List.take_items() method returning the draining iterator - Added comprehensive tests for basic usage, empty list, partial iteration, and bounds reporting Fixes modular#5312 END_PUBLIC Signed-off-by: Dalton Alexandre <166029845+dl-alexandre@users.noreply.github.com>