new requirement of "constexpr" for static const float data members is too restrictive
Gabriel Dos Reis
gdr@integrable-solutions.net
Tue Nov 30 19:04:00 GMT 2010
On Tue, Nov 30, 2010 at 9:07 AM, Miles Bader <miles@gnu.org> wrote:
>> If people are worried about multiple translation units, they
>> will still have to provide a definition outside the class -- most
>> likely
>
> Why?
Because its address may be silently taken (through
binding to references), therefore a definition is needed.
> Certainly as in my experience, that's not true.
That is extra-ordinary, not the norm.
>
> In C++ "static const" is a way of defining constants, and the fact
> that integral class "constants" were allowed whereas floating-point
> class "constants" were not was just a wart.
This misfeature of in-class initialization is a 15-year old debate.
I doubt, it will be resolved on GCC development list.
More information about the Gcc
mailing list