On Wed, Jan 28, 2004 at 12:31:01PM +0100, Lars Gullik Bjønnes wrote: > [EMAIL PROTECTED] (Lars Gullik Bjønnes) writes: > > | Angus Leeming <[EMAIL PROTECTED]> writes: > > > | | Georg Baum wrote: > >>> It compiles if I change line 838 of src/Cursor.C from > >>> > >>> if (t.operator->() != anchor_[depth()].inset()) > > > | I wonder what has been smoked here to think this is a nice > | construct... > > diff -u -p -r1.39 cursor.C > --- cursor.C 26 Jan 2004 10:13:08 -0000 1.39 > +++ cursor.C 28 Jan 2004 11:29:50 -0000 > @@ -835,7 +835,7 @@ bool LCursor::openable(MathAtom const & > // we can't move into anything new during selection > if (depth() == anchor_.size()) > return false; > - if (t.operator->() != anchor_[depth()].inset()) > + if (t.nucleus() != anchor_[depth()].inset()) > return false; > > return true; > > Index: mathed/math_atom.h > =================================================================== > RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_atom.h,v > retrieving revision 1.23 > diff -u -p -r1.23 math_atom.h > --- mathed/math_atom.h 19 Aug 2003 13:00:54 -0000 1.23 > +++ mathed/math_atom.h 28 Jan 2004 11:29:50 -0000 > @@ -58,6 +58,7 @@ public: > void operator=(MathAtom const &); > /// access to the inset (checked with gprof) > MathInset * nucleus() { return nucleus_; } > + MathInset const * nucleus() const { return nucleus_; } > /// access to the inset > MathInset const * operator->() const { return nucleus_; }
This intention of this 'nucleus/operator->' pair instead of the usual 'nucleus/nucleus' pair was to be able to find the non-const accesses with grep. [They are sort of 'unwanted' in the light of potential shared_ptr usage and each use should be justified explicitly...] Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)