C1048: Generate compiler defined <Special member="" function>="">

[DISABLE, INFORMATION , WARNING, ERROR]

Description

A special member function (Copy Constructor, Default Constructor, Destructor, Assignment operator) was created by the compiler. When a class member or a base class contains a Constructor or a Destructor, then the new class must also have this special function so that the base class Constructor or Destructor is called in every case. If the user does not define one, then the compiler automatically generates one.

Example
  struct A {

  
    A(void);

  
    A(const A&amp;);

  
    A&amp; operator =(const A&amp; );

  
    ~A();

  
  };

  
  struct B : A {

  
  };

  
Tips

If you do not want the compiler to generate the special member functions, then enable the option -Cn=Ctr. The compiler only calls a compiler generated function if it is really necessary. Often a compiler generated function is created, but then never called. Then the smart linker does not waste code space for such functions.