On Thu, 25 Oct 2012, Boyce Griffith wrote:

> Is it even possible to have the shim class use operator[] for 
> multidimensional indexing ([i][j])?  I don't know how you setup an equivalent 
> to "operator[][]".  (Such a thing doesn't exist in C++, does it?)

You make your operator[](i) return a temporary of a different class
whose sole reason for existing is "store the number i, and return
element (i,j) from my operator[](j)".  It's not trivial to implement
but it's actually not relatively far down the crazy-C++-idioms rabbit
hole, and IIRC a half-decent compiler can still manage to inline it
down to a zero-cost shim.
---
Roy

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to