POV-Ray : Newsgroups : povray.off-topic : new C# stuff : Re: new C# stuff Server Time
6 Sep 2024 15:16:59 EDT (-0400)
  Re: new C# stuff  
From: Nicolas Alvarez
Date: 24 Jan 2009 13:01:18
Message: <497b576d@news.povray.org>
Darren New wrote:
> In C++ you call
>    qsort(myArray, operator< );
> or some such syntax, but without the need to have a specifically named
> function just to wrap up the < operator.

std::sort(myArray) is all you need. Guess *how* the operator< is used by
default?

template <typename T> bool less(const T& x, const T& y) {
    return x < y;
}

std::sort uses std::less as the default sorting function.


Post a reply to this message

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