POV-Ray : Newsgroups : povray.off-topic : new C# stuff : Re: new C# stuff Server Time
6 Sep 2024 15:22:09 EDT (-0400)
  Re: new C# stuff  
From: Warp
Date: 24 Jan 2009 14:15:31
Message: <497b68d3@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Yep. And now what do you do if the "less" you want to use is actually a 
> member function of type T?  What if the "less" you want to use is
> class MyDate {
>    bool comesBefore(const MyDate& otherDate);
> }

  You create a comparator and give that to std::sort. A comparator can be,
for example, a (regular) function which takes two elements and returns bool.

-- 
                                                          - Warp


Post a reply to this message

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