I have a class that contains a static member variable, I would like to initialize it using an anonymous namespace in the .cpp file just like what I saw in the link :Where to put constant strings in C++: static class members or anonymous namespaces
But I am getting an error saying the current member rate cannot be defined in the scope. Why?
//A.h
namespace myclass
{
class A
{
   private:
      static double rate;
};
}
//A.cpp
namespace myclass
{
   namespace{
      double A::rate = 99.9;
  }
}
 
     
    