help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fortran_vec() vs data() - very first element is lost


From: c.
Subject: Re: fortran_vec() vs data() - very first element is lost
Date: Mon, 24 Oct 2016 23:34:15 +0200

On 24 Oct 2016, at 21:52, Olaf Till <address@hidden> wrote:

> Looking into Octave-4.0, fortran_vec() differs from data() in having
> two versions, one returning a const pointer, the other a non-const
> pointer. I've searched a bit but could not find a rule what type is
> substituted for 'auto' in this case -- the const on or the non-const
> one. Could this possibly cause undefined behaviour of the compiler?
> Does anyone know this?

AFAIK, the 'const' version should be used if invoking the method from
a const object while the non 'const' method should be used if invoking
the the method from a non 'const' object.

This behaviour should be the same whether 'auto' is used or the full 
type specification for the returned pointer ...

HTH,
c.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]