On Sun, May 29, 2005 at 09:58:22PM +0300, Martin Vermeer wrote:
> On Sat, May 28, 2005 at 12:12:07AM +0200, Lars Gullik Bjønnes wrote:
  
> > | +inline flags operator|(flags const f, flags const g) 
> > | +{
> > | + int const intf(static_cast<int>(f));
> > | + int const intg(static_cast<int>(g));
> > | + return static_cast<flags>(intf | intg);
> > | +}
> > 
> > Is the temporary ints needed?
> > 
> > 
> > inline flags operator|(flags const f, flags const g)
> > {
> >         return static_cast<flags>(f | g);
> > }
> > 
> > should be enough.
> 
> Yes, of course. Silly of me.

No, silly of you, Lars :-)

In your version, the operator | in the return statement has the signature
(flags, flags). Not (int, int) as we intend. As a result, flags operator| 
gets called recursively and LyX crashes on a stack overflow...

- Martin

Attachment: pgpnGn0aoAMQH.pgp
Description: PGP signature

Reply via email to