This is the mail archive of the
gsl-discuss@sourceware.org
mailing list for the GSL project.
Re: containers tentative design summary
At Thu, 29 Oct 2009 17:40:30 -0400,
James Bergstra wrote:
> If the purpose is to protect the user from accidentally messing around
> with data then, as Gerard suggests, maybe we shouldn't bother. This
> is not a battle that we can win in C. Good naming conventions for
> functions, which indicate the arguments that will be modified, is the
> most that a C library is expected to provide.
The purpose is to make programs safer, rather than provide any hints
for optimisation. The current system is type-safe and gives a
"discarding const" compiler warning if people try to pass const
objects to functions as non-const arguments - these seem like useful
features. It's not clear to me what the actual benefit would be if we
only had non-const vectors and matrices.