Boost logo

Ublas :

From: Neal Becker (ndbecker2_at_[hidden])
Date: 2005-08-18 11:57:50


Michael Stevens wrote:

> Gunter,
>
> On Thursday 18 August 2005 14:49, Gunter Winkler wrote:
>> Hello,
>>
>> last night I got another idea. Can we give a partial specialization of
>> the unbounded_array constructor for std::complex?
>>
>> template<class ALLOC>
>> unbounded_array< std::complex<double>, std::allocator<
>> std::complex<double> >
>> unbounded_array(size_type size, ALLOC A) {
>> ... skip the call of new ? ...
>> }
>
> Sound like the way to do it. Has the advantage it can be done by the user
> for any type. Or do you thing we should add it by default to uBLAS for
> std::complex with float double and long double?
>

I still like to be able to control this myself. That solves the problem of
complex (but only if you want to not call default init!), but as long as
we're on the subject, why not give the user the ability to control this? I
think the optional arg to the constructor is the way to go. Making it a
parameter of the storage class caused my head to hurt. Before long, I
found that code wouldn't compile, due to problems converting
vector_expression to vector, or something like that. I think the simple,
direct approach is preferable here.