title: C++ passing base type to pure virtual function
body: <p>i want to understand the behavior of pure virtual functions in derived class when passing to it an argument of same type as (abstract) base class.</p>
  
  <p>to clarify the question, i took the following code from GeeksForGeeks and modified it:</p>
  
  <pre><code>namespace example {
  enum Type {ENGINEER, MANAGER};
  class Employee
  {
  private:    
      const Type worker;
  public:
      Employee(const Type&amp; worker) : worker(worker) {}
      virtual ~Employee {}
  
      virtual void raiseSalary(const Employee&amp;) = 0;
      {  /* common raise salary code */  }
  
      virtual void promote(const Employee&amp;) = 0;
      { /* common promote code */ }
  };
  
  class Manager: public Employee {
      private:
          int degree;
      public:
          //&lt;constructor&gt;\\
  
      virtual void raiseSalary(const Employee&amp;)
      {  /* Manager specific raise salary code, may contain
            increment of manager specific incentives*/  }
  
      virtual void promote(const Employee&amp;)
      { /* Manager specific promote */ }
  };
  </code></pre>
  
  <p>}</p>
  
  <p>Now, how can we get access to the field <code>degree</code> in derived class <code>Manager</code> inorder to update his <code>degree</code>? since the passed argument to <code>raiseSalary(Employee&amp; employee)</code> could be <code>Manager</code> or <code>Engineer</code></p>