Add Sum::iter dev

Sat, 19 Oct 2024 10:39:54 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Sat, 19 Oct 2024 10:39:54 -0500
branch
dev
changeset 39
dd144a972722
parent 38
8aaa22fcd302
child 40
daf0e3a70c79

Add Sum::iter

src/mapping.rs file | annotate | diff | comparison | revisions
--- a/src/mapping.rs	Tue Feb 20 12:34:17 2024 -0500
+++ b/src/mapping.rs	Sat Oct 19 10:39:54 2024 -0500
@@ -110,6 +110,11 @@
     pub fn new<I : Iterator<Item = M>>(iter : I) -> Self {
         Sum { components : iter.collect(), _domain : PhantomData }
     }
+
+    /// Iterate over the component functions of the sum
+    pub fn iter(&self) -> std::slice::Iter<'_, M> {
+        self.components.iter()
+    }
 }
 
 

mercurial