static-const-integral in-class-init without explicit definition

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

 



Since when, gcc started to allow usage of

static const integral type class members to be initialized in-class
and compile/link successfully without explicit definition in .cpp

That is,
//A.h
class A
{
 public:
 int do_something_stupid();
 private:
 static const int NUM=5;
}
//A.cpp
...
int A::do_something_stupid()
{
  return NUM; //SUCCESSFUL without explicit definition
}

Thanks
Raja Gopal
smrajagopal [at] gmail [dot] com




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux