POV-Ray : Newsgroups : povray.off-topic : My first C++ program : Re: A test Server Time
30 Sep 2024 21:29:50 EDT (-0400)
  Re: A test  
From: Darren New
Date: 23 Sep 2008 21:36:24
Message: <48d99998$1@news.povray.org>
Warp wrote:
>   I don't know... This kind of defeats the whole purpose of a high-level
> language where you are supposed to not to have to worry about internal
> implementation details of the compiler.

I think you could do it the same way you do it in C, if you need to: 
iterate over the list and add up only the elements you're interested in.

fold goes from yadda.begin() to yadda.end(). If you don't want to do 
that, use a different function. Or write it more iteratively, so to 
speak. Think about your C++ implementation of fold - you would have to 
copy the list there too if you wanted to use that on a subset.

-- 
Darren New / San Diego, CA, USA (PST)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.