Employees and Organizational Hierarchy
1. Don't use using namespace std

That's generally considered bad practice.

Rather use

using std::cout;
using std::cin;
using std::string;


if you want to avoid typing these out.

2. Use interfaces properly and don't mix them up with abstract class implementations


Instead of simply declaring an abstract class, sort out specific interfaces in 1st place

struct IEmployee {
      virtual const&amp; string name() const = 0; // see 3. regarding const please
      virtual const float&amp; salary() const = 0;
      virtual bool managesOtherEmployees() const = 0; // equivalent to isLeaf() in the
                                                      // common composite pattern
                                                      // examples
      virtual void work() = 0; 
};

Add functionality as needed:

struct IManager {
    void add(IEmployee&amp;) = 0;
    void delete(IEmployee&amp;) = 0; // if you have functions to extend the
                                 // composition, you probably want to have
                                 // the reverse operation if reasonable.
                                 // Here it seems to be so, since managers 
                                 // sometimes need to fire team members.
};

Provide the abstract class for the common implementation

class Employee : public IEmployee {
private:
    string name_; // Don't use prefix '_' for symbols, these are reserved 
                    // for the compiler and standard library implementations (see 4.)
    float salary_;
public:
    Employee(string name, float salary) : name_(name), salary_(salary) {}
    string name() const override {
        return name_;
    }
    float salary() const override {
        return salary_;
    }
    bool managesOtherEmployees() const override { return false; }
};



2. leads to an implementation of Developer and Manager classes as follows:

class Developer : public Employee {
public:
    Developer(string name,float salary) : Employee(name,salary) {}
    void work() {
         cout &lt;&lt; "Developer " &lt;&lt; name() &lt;&lt; " Worked\n";
         // A developer works own.
    }
};

class Manager : public Employee, public IManager {
private:
    vector&lt;std::reference_wrapper&lt;IEmployee&gt;&gt; team_; 
public:
    Manager(string name, float salary) : Employee(name,salary) {}
    bool managesOtherEmployees() const override { return true; }
    void add(IEmployee&amp; emp) override {
        team_.push_back(std::reference_wrapper&lt;IEmployee&gt;(emp));
    } 
    void delete(IEmployee&amp; emp) override {
        std::remove(team_.begin(),team_.end(),std::reference_wrapper&lt;IEmployee&gt;(emp));
    }
    void work() {
        cout &lt;&lt; "Manager " &lt;&lt; name() &lt;&lt; " Distributed Work\n"; 
        for(auto&amp; emp : team_) { // Use range based loops and auto whenever possible (see 5.)
            emp.work();
        }
        // A manager distributes work in team members.
     }
     float salary() const override {
        float accumulatedSalary = 0.0;
        for(const auto&amp; emp : team_) { // Note const and reference again
            accumulatedSalary += emp.salary() +15000;
        }
        return accumulatedSalary;
        // Salary of a manager is derived from team members.
     }
};


3. Use const qualifiers as much as possible

If you're declaring a class operation (class member function), decide if this should change the class state in first place.
Append a const qualifier, if you decide it shouldn't.

Same for parameters and return values. Usually you don't have to worry about which method by value or by const reference will be more efficient.
With any sophisticated, modern c++ compiler, you can assume the most efficient emitted assembly code will be chosen.

Passing/returning by value, still might be prone to generate copies if RVO isn't applicable. Thus I simply prefer to be explicit about that.

4. Don't use symbol names prefixed with _

Symbol names prefixed with a single or double underscore (_) are preserved by the c++ standard for compiler internals and standard library implementations.

It's easy to come over that just using underscores as a postfix for symbols as indication of class member variables:

template&lt;typename TValue&gt;
class MyClass {
private:
     TValue myValue_;
public:
     MyClass(const TValue&amp; myValue) : myValue_(myValue) {}
     const TValue&amp; myValue() { return myValue_; } // standard getter signature
     void myValue(const &amp; TValue value) { myValue_ = value; } // standard setter signature
};


The above pattern will serve 98% of cases unambiguously quite well.

5. Use range based loop syntax beyond c++98

Since c++11 standard was established, the language supports range based for() loops of the form

for(&lt;type spec&gt; el : &lt;container_ref&gt;) { /* ... */ }

You should use the auto keyword for &lt;type spec&gt;, it can be garnished with const and &amp; as usual, and automatically evaluates a dereferenced Iterator when enumerating the Containers values.