Re: C++ is Slow?
On Feb 7, 12:26 pm, nw <n...@soton.ac.uk> wrote:
Having op[] return a dummy object is a poor idea, it makes
it harder to drop in different implementations. Only do
something like that if you absolutely have to. See the FAQ
for more about this subject.
http://www.parashift.com/c++-faq-lite/operator-overloading.html#faq-1..=
..
The FAQ is wrong about this. The choice between [i][j] and
(i,j) should depend on personal preference and local
conventions; both offer exactly the same possibilities for
optimization and supporting different implementations.
My reading was that the FAQ indicates that you can use [i][j]
but tries to steer you away from it because it will be harder
to implement.
Not significantly. My reading was that it also raised
performance issues, which aren't present either.
I'm veering towards a Matrix object with a operator() but I
find it unfortunate that the STL doesn't already provide such
an object, doing so would provide a standardized interface
which would let people create compatible Matrix objects
optimized for different platforms, spare matrices etc.
Are there are any plans for this to be added to a future standard?
It's probably true that there is a need for true
multi-dimensional arrays. To date, however, I don't think that
there has been a proposal.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34