Boost logo

Ublas :

From: David Abrahams (dave_at_[hidden])
Date: 2005-06-24 12:52:10


Gunter Winkler <guwi17_at_[hidden]> writes:

> On Monday 20 June 2005 11:44, Ian McCulloch wrote:
>> So, how about
>>
>> Vector<double> x; // default: forces 'safe' handling of aliases
>> Vector<double, noalias> y; // fast: user takes responsibility for aliases
>
> This looks really good. Here both strategies are possible, the user has the
> choice and it has a clear and short syntax. I vote for this version.

It puts the information in the wrong place. Whether or not there will
be aliasing in an expression depends on that expression, not on the
types of the objects used in it. I'd rather have the notation that
there is no aliasing as part of the expression so they don't get out
of synch. Objects can come from anywhere -- imagine passing a
vector<double,noalias> to a generic function.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com