On Tue, Nov 30, 2010 at 5:39 AM, Richard Guenther
<richard.guent...@gmail.com> wrote:
> On Tue, Nov 30, 2010 at 9:17 AM, Miles Bader <mi...@gnu.org> wrote:
>> On Tue, Nov 30, 2010 at 5:13 PM, Gabriel Dos Reis
>> <g...@integrable-solutions.net> wrote:
>>> If you are doing that, why don't you write a simpler code by
>>> just defining (e.g. initializing) the data member outside the class?
>>
>> 'cause I want the compiler to be able to use (inline) the underlying values.
>
> I think it'll do that with initializing the member outside of the class as 
> well.
>
> struct X { static float const v; };
> const float X::v = 1;
> int main()
> {
>  return (int)X::v;
> }
>
> at least works for me (even when not optimizing - huh).

I agree.  I think we have a case here where people will
say anything to justify a (mis)feature that leads to brittle
codes, and even more so a deprecated extension.
If people are worried about multiple translation units, they
will still have to provide a definition outside the class -- most
likely.  Which makes me really doubtful that the in-class initialization
provides a better alternative than the standard namespace scope
constant idiom.

Anyway, all this started as a confusion, and as far as I'm concerned
it is a non-issue.  It is up to you guys to decide what you do with it --
I don't think it really is a service to keep it.

-- Gaby

Reply via email to