POV-Ray : Newsgroups : povray.off-topic : My first C++ program : Re: A test Server Time
30 Sep 2024 19:28:49 EDT (-0400)
  Re: A test  
From: Nicolas Alvarez
Date: 24 Sep 2008 15:37:41
Message: <48da9705@news.povray.org>
Warp wrote:
> Invisible <voi### [at] devnull> wrote:
>> Now what happens if you want to only process elements having some
>> arbitrary property? (E.g., only the odd numbers.)
> 
> I make the function take a functor which tells which elements to
> process.
> This is a standard technique in C++.

You can even write a custom iterator that, when incremented, skips even
numbers. Then you can use it with the existing fold function.


Post a reply to this message

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