|
From: marco\.tarenghi\@libero\.it <mar...@li...> - 2006-08-30 09:03:09
|
Hi all,
I think I've found a bug in the TimeSeries class.
There it is implemented the [] operator in two different ways, I think th=
e second one is wrong: more in detail, according to me the operator retur=
ning a reference contains an error in the "if" condition
T& operator[](const Date& d) {
if (values_.find(d) !=3D values_.end())
values_[d] =3D Null<T>();
return values_[d];
}
}
it should be "=3D=3D" and not "!=3D", otherwise in the case it finds the =
date it returns a Null<T> value.
Probably it has been mis-specified because it replicates the implementati=
on of the alternative [] operator, but in that case the output is differe=
nt and the operator works fine.
By the way, if I instantiate a TimeSeries object and then I use the [] op=
erator, how does the object know which is implementation to choose?
Thanks,
Marco=0A=0A=0A___________________________________________________________=
________=0APrestiti da 15 istituti. Tan dal 5,90% per richieste entro il =
15 Settembre. Servizio gratuito.=0Ahttp://click.libero.it/mutuionline3=0A=
|