This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: gsl_vector_const_view: pointer to constant or constant pointer
- From: Brian Gough <bjg at network-theory dot co dot uk>
- To: Fleur Kelpin <fleur at bio dot vu dot nl>
- Cc: gsl-discuss at sources dot redhat dot com
- Date: Sun, 11 Aug 2002 23:17:46 +0100 (BST)
- Subject: Re: gsl_vector_const_view: pointer to constant or constant pointer
- References: <Pine.GSO.4.44.0208100523410.15912-100000@ursus>
Fleur Kelpin writes:
> Am I missing something or can/could/should this be fixed?
> (I think this can be done by moving the const inside the struct:
>
> typedef struct
> {
> const gsl_vector vector;
> } _gsl_vector_const_view;
It's not possible to initialise the struct element with this form in
ANSI C (although it is possible in gcc). This is why the const'ing is
done at a higher level in a wrapper.