]> www.ginac.de Git - ginac.git/commitdiff
added an example using copy() to output the elements of a lst
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Mon, 19 May 2003 21:27:37 +0000 (21:27 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Mon, 19 May 2003 21:27:37 +0000 (21:27 +0000)
doc/tutorial/ginac.texi

index 358ea9115ebb865ba5ef94603b3fbb03a729485c..444933c938dba0eff4e3eb347483b3b238c32e12 100644 (file)
@@ -1343,6 +1343,9 @@ the C++ standard library:
 
 @example
     ...
+    // print the elements of the list (requires #include <iterator>)
+    copy(l.begin(), l.end(), ostream_iterator<ex>(cout, "\n"));
+
     // sum up the elements of the list (requires #include <numeric>)
     ex sum = accumulate(l.begin(), l.end(), ex(0));
     cout << sum << endl;  // prints '2+2*x+2*y'