Boost logo

Ublas :

From: glen stark (stark_at_[hidden])
Date: 2005-02-16 12:08:03

am I correct that the scalar_vector does not support the assignement
operator for value types?

in other words, it seems I can't do the following:

    scalar_vector<double> someScalarVector(3,2.0);
    someScalarVector = 3;

Was this a design decision? May I ask the reasoning behind it? I would
think the above usage would be quite useful. Is there another method in
mind for the above behavior? The only thing I can see from the
documenation woudl be to create a temporary scalar_vector and assign this...

Is there a reason why the following addition would be a bad idea?
        scalar_vector &assign_temporary (scalar_vector &v) {
            swap (v);
            return *this;

Thanks for your time and attention.