From f830c55c9fe3fc7a6800ff894095c0372bb90b5e Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Mon, 19 May 2003 21:27:37 +0000 Subject: [PATCH] added an example using copy() to output the elements of a lst --- doc/tutorial/ginac.texi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/tutorial/ginac.texi b/doc/tutorial/ginac.texi index 358ea911..444933c9 100644 --- a/doc/tutorial/ginac.texi +++ b/doc/tutorial/ginac.texi @@ -1343,6 +1343,9 @@ the C++ standard library: @example ... + // print the elements of the list (requires #include ) + copy(l.begin(), l.end(), ostream_iterator(cout, "\n")); + // sum up the elements of the list (requires #include ) ex sum = accumulate(l.begin(), l.end(), ex(0)); cout << sum << endl; // prints '2+2*x+2*y' -- 2.49.0