POV-Ray : Newsgroups : povray.off-topic : new C# stuff : Re: new C# stuff Server Time
6 Sep 2024 15:18:52 EDT (-0400)
  Re: new C# stuff  
From: Warp
Date: 24 Jan 2009 14:44:57
Message: <497b6fb9@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Warp wrote:
> > 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.

> And that's precisely what the C# syntax avoids you having to do, in the 
> other direction.

  So instead of writing a function which takes two objects and returns
a bool, you write a "member function" which which called with one object,
takes another as parameter, and returns bool?

  I'm still not seeing the huge difference.

-- 
                                                          - Warp


Post a reply to this message

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