|
From: Luigi B. <lui...@gm...> - 2011-01-07 15:24:34
|
On Tue, 2011-01-04 at 10:22 +0000, Simon Ibbotson wrote: > Unfortunately, that would mean producing a specialised template routine > for McSimulation::value() (and others) as we cannot instantiate both > result_type of Array and result_type of double using begin() and end() > arguments. That would take us back to the beginning of this email > chain... Oh, rats. > I personally would go for a constructor of Array(const > std::vector<double>&) for simplicity. Would you agree? Hmm, I don't like coupling Array and vector. I'd try doing it as locally as possible. For example, in McSimulation, we could use two template functions copy and combine (add? average?) instead of operator= and operator+ so that we can write specializations for double and Array/vector. -- All generalizations are dangerous, even this one. -- Alexandre Dumas |