29 Jul
2009
29 Jul
'09
1:07 p.m.
Roman Perepelitsa wrote:
2009/7/29 Mathias Gaunard
mailto:mathias.gaunard@ens-lyon.org> 1) struct S { static const size_t maxsize =5; };
It explains why 2 returns false, but does not explain why 1 does not compile.
Because static const <integral type> = <some value> members are quite special beasts. Indeed, unlike other static members, you can't take their address, since they don't exist in memory but only as compile-time constants. Testing whether the type is integral is not enough either, since if there is no definition they behave like normal static members.