Re: Small fix for GCC 4.6 issue

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

 



Am 15.05.2011 23:45, schrieb Klaus Schmidinger:
> On 14.05.2011 13:06, Tobi wrote:
>> Right. The C++ standard explicitly requires an "user-declared default
>> constructor" here.
>>
>>> So it should also work if you add an empty
>>> constructor cCursesFont::cCursesFont() { }  ???
>>
>> Yes. Either this or -fpermissive. But personally I prefer the initializer
>> here, but I must admit I don't understand the technical reason, why the
>> standard requires a user defined default constructor at all.
> 
> I also have to admit that I don't understand what difference this makes.
> Apparently the program works, so the initialization must be taking place,
> even without explicitly calling cCursesFont().


What makes this even more strange to me is the fact, that

  static const cCursesFont Font;

requires an user-declared default constructor, while

  static const cCursesFont Font = cCursesFont();

creates an temporary non-const cCursesFont object, and then uses the
implicitly declared copy constructor to create the final Font object. So
why is the implicitly declared default constructor forbidden, and the
implicitly declared copy constructor ok?


You'll really need an lawyer when it comes to standards specifications...


Cheers,

Udo

_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux