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.