title: Overloading Assignment Operator for a Class with Structure and enum's
body: <p>I was trying to overload assignment operator for this Class.
  How to do this for class containing Structures and enumerators?</p>
  
  <pre><code>class Config
  {
  public:
      Config() { SetDefaults(); }
      Config(const std::string&amp; path);
  
      enum FeatureType
      {
          kFeatureTypeHaar,
          kFeatureTypeRaw,
      };
  
      enum KernelType
      {
          kKernelTypeLinear,
          kKernelTypeGaussian };
  
      struct FeatureKernelPair
      {
          FeatureType feature;
          KernelType kernel;
          std::vector&lt;double&gt; params;
      };
  
  bool quietMode;    
  std::string sequenceBasePath
  int frameHeight;
  std::vector&lt;FeatureKernelPair&gt;  features;
  
  friend std::ostream&amp; operator&lt;&lt; (std::ostream&amp; out, const Config&amp; conf);
  
  private:
      void SetDefaults();
      static std::string FeatureName(FeatureType f);
      static std::string KernelName(KernelType k);
  };
  </code></pre>
  
  <p>This is what i had tried. This is the general way to do it,right..?</p>
  
  <pre><code>Config &amp; operator=(Config const&amp;c) {
      if(this != &amp;c){
              quietMode = c.quietMode;
              sequenceBasePath = c.sequenceBasePath;
              frameHeight = c.frameHeight;
              features = c.features;
          }
      return *this;
  
  }
  </code></pre>