lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Further GUB failure


From: Dan Eble
Subject: Re: Further GUB failure
Date: Sun, 23 Aug 2015 14:20:25 -0400

David wrote:
> isinf is supposed to be defined in cmath (without scoping) which is
> included by flower/include/offset.hh.  And of course this works on most
> platforms or we'd have gotten complaints already.

What’s your source?  http://en.cppreference.com/w/cpp/numeric/math/isinf shows 
that the isinf() provided by cmath is in the std namespace, and only since 2011.

> Dan, wasn't the idea of the patch to remove "using std" from the
> _include_ files where they'd mess with the namespace of arbitrary files
> including them?

That was the important part.  I went farther and removed it entirely because it 
is considered good practice to avoid using everything in the std namespace.

In issue 4550, I chose to write std::whatever() for many things even in *.cc 
files.  I did add “using std::whatever;” for container types because those are 
very frequently used in Lilypond and I didn’t want people to feel like I came 
in and trashed the joint.

> Wouldn't that mean that a good fix not defeating the
> original purpose of the patch would be to just put the respective using
> statement in the .cc files?

That’s probably the simplest option for those who are dealing with the problem. 
 If they can afford the time to be specific, e.g.

    using std::isinf;
    using std::isnan;
    ...

That would be better.  It would also make it easier for someone (I volunteer) 
to replace them later with in-loco std::whatever() to return to consistency 
with the style set in issue 4550.

I’m sorry my patch caused these problems!

Regards,
— 
Dan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]