Re: OONSTD: Alias-free arrays

Todd Veldhuizen (tveldhui@seurat.uwaterloo.ca)
Thu, 16 Jul 1998 17:56:57 -0400 (EDT)

Gabriel Dos Reis wrote:
> ERT> If computer architecture evolves to favor a different representation,
> ERT> all the application programs that rely on access to the underlying
> ERT> representation would suddenly become obsolete.
>
> I think it is a trivial statement that there cannot be a universal
> matrix representation. Given that, one needs an alias-free 1D
> array. For one dimensional array, valarray<> is good enough. I do see
> valarray<> as a fondamental building block. I don't consider
> valarray<> in the same way as string. I expect compiler writers to
> follow the standard wording.

Having the NCEG "restrict" keyword would be more useful
than a built-in alias-free array class like valarray<>.
The restrict keyword has apparently been adopted into the C9x
standard, so hopefully it will become part of C++ in the future.
Already several C++ compilers support it (Cray,KAI C++,SGI).

Btw, if you're interested in what the fuss is over aliasing
and restrict, there is some material which explains why aliasing
can cause poor performance: see pp. 53--56 of the "Techniques
for Scientific C++" slides available from
http://seurat.uwaterloo.ca/blitz/papers/

Cheers,
Todd