S
Steven T. Hatton
What's a good STL way of performing compound assignments using the elements
of one STL-like collection as the rhs and the correspondingly indexed
elements of another collection as the lhs? IOW:
template<typename T, size_t Size_S>
boost::array<T,Size_S>& operator+=(boost::array<T,Size_S>& lhs
, const boost::array<T, Size_S>& rhs) {
for(size_t i = 0; i < Size_S; i++) { lhs += rhs; }
return lhs;
}
--
"If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true." - Bertrand
Russell
of one STL-like collection as the rhs and the correspondingly indexed
elements of another collection as the lhs? IOW:
template<typename T, size_t Size_S>
boost::array<T,Size_S>& operator+=(boost::array<T,Size_S>& lhs
, const boost::array<T, Size_S>& rhs) {
for(size_t i = 0; i < Size_S; i++) { lhs += rhs; }
return lhs;
}
--
"If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true." - Bertrand
Russell