Re: TMath::Sort :: warning if n < array size

From: Adrian Sevcenco <Adrian.Sevcenco_at_cern.ch>
Date: Mon, 22 Aug 2011 01:10:13 +0300


On 08/21/11 23:56, Axel Naumann wrote:
> Hi,

Hi!

> On 8/21/11 4:43 PM, Adrian Sevcenco wrote:

>> On 08/21/11 16:58, Axel Naumann wrote:
>>> Thanks for your suggestion. We can't determine the sizeof(index), all we
>>> have is a pointer (not an array), and that would just return you
>>> sizeof(void*).
>> hmm .. that would mean that the arrays that are the arguments are
>> deprecated somewhere somehow to (void*)

>
> Deprecated? I don't understand that. Maybe you're referring to the
> array-to-pointer decay? Yes, that's the case when calling Sort() passing
yeah sorry, poor wording .. i meant array2pointer decay .. Anyway, thanks for info,

Adrian

> an array in.
>
> Sort() only sees the starting address of the arrays (const Element*,
> Index*), it doesn't know their size which needs to be provided through
> the argument "n".
>
> Cheers, Axel.

Received on Mon Aug 22 2011 - 00:09:09 CEST

This archive was generated by hypermail 2.2.0 : Mon Aug 22 2011 - 17:50:02 CEST