help-octave
[Top][All Lists]
Advanced

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

Re: single/double precision in C++


From: Jaroslav Hajek
Subject: Re: single/double precision in C++
Date: Tue, 10 Nov 2009 13:00:44 +0100



On Tue, Nov 10, 2009 at 12:56 PM, John W. Eaton <address@hidden> wrote:
On 10-Nov-2009, Jaroslav Hajek wrote:

| + // const_casts are necessary because LTFAT doesn't specify const on input data.
| + lib_func (const_cast<T1 *>(f.fortran_vec ()), const_cast<T2 *>(gf.fortran_vec ()),
| +           L, W, R, a, M, cout.fortran_vec ());

Maybe I'm missing something, but I don't see why the const_cast is
necessary here.  The result of fortran_vec is not const.


The result of fortran_vec *is* const when called on a const variable, which is the case here. In this sense, fortran_vec behaves just like the elem() functions. data () is a const-only method.


--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

reply via email to

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