[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Set indent based on instrument name (issue 6457049)
From: |
David Kastrup |
Subject: |
Re: Set indent based on instrument name (issue 6457049) |
Date: |
Tue, 31 Jul 2012 12:59:16 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
Graham Percival <address@hidden> writes:
> On Mon, Jul 30, 2012 at 11:44:28PM +0100, Bernard Hurley wrote:
>> On Mon, Jul 30, 2012 at 10:14:37PM +0100, Phil Holmes wrote:
>> > ----- Original Message ----- From: <address@hidden>
>> >> lily/output-def.cc:38: Real long_name_len = 0.0;
>> >> could these be class member variables instead of global variables?
>> >
>> > I don't believe so. I'd be happy to be corrected by someone who
>> > understands this better than I do, but my understanding of c++ (which I
>> > guess at based on c#) says that, in order to access a class member
>> > variable, you need to have an instantiation of the class.
>
> That is true.
>
>> In C++ variables can be declared static. If this is done all instances of
>> the class share the same instance of the variable and it can exist
>> even if the class has no instances see:
>
> Yes, that's also true.
>
> Let me rephrase my concern: in C++-land, having a global variable
> (including static variables) are viewed upon like picking one's
> nose.
That's total nonsense with regard to static member variables. There are
perfectly valid reasons to have variables per-class (which is what a
static member variable is) rather than per instance, for example for
class reflection (information about the class itself, like its name and
other stuff). C++ uses the equivalent of static members for its virtual
function tables.
For information _flow_ bound to instances, one would not use global
variables.
It sounds like this would be the case here.
--
David Kastrup
- Re: Set indent based on instrument name (issue 6457049), (continued)
- Re: Set indent based on instrument name (issue 6457049), Phil Holmes, 2012/07/31
- Re: Set indent based on instrument name (issue 6457049), David Kastrup, 2012/07/31
- Re: Set indent based on instrument name (issue 6457049), Phil Holmes, 2012/07/31
- Re: Set indent based on instrument name (issue 6457049), David Kastrup, 2012/07/31
- Re: Set indent based on instrument name (issue 6457049), Phil Holmes, 2012/07/31
- Re: Set indent based on instrument name (issue 6457049), David Kastrup, 2012/07/31
- Re: Set indent based on instrument name (issue 6457049), Graham Percival, 2012/07/31
- Re: Set indent based on instrument name (issue 6457049), David Kastrup, 2012/07/31
- Re: Set indent based on instrument name (issue 6457049), Phil Holmes, 2012/07/31
- Re: Set indent based on instrument name (issue 6457049), Graham Percival, 2012/07/31
- Re: Set indent based on instrument name (issue 6457049),
David Kastrup <=
- Re: Set indent based on instrument name (issue 6457049), Bernard Hurley, 2012/07/31
Re: Set indent based on instrument name (issue 6457049), dak, 2012/07/31