POV-Ray : Newsgroups : povray.off-topic : Standard libraries : Re: Standard libraries Server Time
6 Sep 2024 13:20:07 EDT (-0400)
  Re: Standard libraries  
From: Warp
Date: 6 Mar 2009 20:08:22
Message: <49b1c906@news.povray.org>
Nicolas Alvarez <nic### [at] gmailcom> wrote:
> std::for_each(someList.begin(), someList.end(), [&total](int x) {
>   total += x
> });

  I think they are also considering adding alternative versions of all
algorithms which take an iterator range. These alternative versions would
take a container and automatically apply the algorithm to all of its
elements, so you could just write:

    std::for_each(someList, [&total](int x) { total += x });

-- 
                                                          - Warp


Post a reply to this message

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