STL algorithms and GiNaC::lst

Christian Bauer Christian.Bauer at Uni-Mainz.DE
Sun Jan 25 15:56:52 CET 2004


Hi!

On Sun, Jan 25, 2004 at 01:19:51PM +0300, Sheplyakov Alexei wrote:
> 	lst_prod test;
> 	for_each(l.begin(), l.end(), test);

The functor used by for_each() is a copy of "test". Try this instead:

    lst_prod test = for_each(l.begin(), l.end(), lst_prod());

Bye,
Christian

-- 
  / Physics is an algorithm
\/ http://www.uni-mainz.de/~bauec002/



More information about the GiNaC-list mailing list