Adjacency list Graph representation Following is the graph I used to create adj list. 



The code should follow all the best practices of C++ 14 and stl.

map is used instead of vector to keep label.

Any suggestions for better implementation are welcome. 
.h

#pragma once

#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;list&gt;
#include &lt;unordered_map&gt;
#include &lt;algorithm&gt;

using std::unordered_map;
using std::list;
using std::pair;
using std::cout;
using std::endl;
using std::make_pair;
using std::for_each;

class AdjList
{
private:

    typedef pair&lt;int, char&gt; edge;
    unordered_map&lt;char , list &lt;edge&gt; &gt; adjList;

public:
    void createGraph();
    void printGraph();
    void test();
};


.cpp

#include "AdjList.h"

void AdjList::createGraph()
{
    list&lt;edge&gt; A;
    A.push_back(make_pair(3, 'B'));
    A.push_back(make_pair(2, 'E'));

    list&lt;edge&gt; B; //B points nowhere

    list&lt;edge&gt; C;
    C.push_back(make_pair(1, 'A'));

    list&lt;edge&gt; D;
    D.push_back(make_pair(4, 'C'));

    list&lt;edge&gt; E;
    E.push_back(make_pair(4, 'D'));

    adjList['A'] = A;
    adjList['B'] = B;
    adjList['C'] = C;
    adjList['D'] = D;
    adjList['E'] = E;

}

void AdjList::printGraph()
{
    for each (auto elem in adjList)
    {
        cout &lt;&lt; elem.first &lt;&lt; " -&gt; ";

        for_each(elem.second.begin(), elem.second.end(), [](auto val) {

            cout &lt;&lt; val.second &lt;&lt; "(" &lt;&lt; val.first &lt;&lt; "), ";

        });

        cout &lt;&lt; endl;
    }
}

void AdjList::test()
{
    createGraph();
    printGraph();
}


test() is called from main to test.

Output:


  A -> B(3), E(2),
  
  B ->
  
  C -> A(1),
  
  D -> C(4),
  
  E -> D(4),
Good work!
Do not polute the global namespace in headers
using std::unordered_map;
...

Anyone who #includes your file will have these imported in their global namespace. You should should migrate these to your .cpp file, and just use std:: for the two instances in the header.
list&lt;&gt; vs vector&lt;&gt;
There is nothing in your code that suggests list&lt;&gt; is preferable to vector&lt;&gt;. Unless you need fast insertion/removal in the middle of the structure, vector&lt;&gt; is preferable here.
For each ( in ) is not a thing
for each (auto elem in adjList) is not standard C++, but a MSVC extension, use range-based for instead. Furthermore, by using auto instead of auto &amp;, you are working on copies of the adjacency list, not references.
You want this:
for(auto const&amp; elem : adjList) {

Don't use for_each when a range-based for works.
for_each is not best practice unless you are already manipulating a predicate. range-based-for is preferable:
Like so:
for(auto const&amp; val : elem.second) {
    cout &lt;&lt; val.second &lt;&lt; &quot;(&quot; &lt;&lt; val.first &lt;&lt; &quot;), &quot;;
}

Emplace into containers
You want to use emplace_back() instead of push_back() in containers where possible:
Like So:
list&lt;edge&gt; C;
C.push_back(make_pair(1, 'A')); // bad
C.emplace_back(1, 'A'); // much better

Move containers if you know you are done with them.
When you do this:
adjList['A'] = A;

You create a copy of A, when you know you are done with it. You should promote A to a RValue:
adjList['A'] = std::move(A);

You are mixing your functionality with your test harness
createGraph(); and test(); have no business being members of this class, and should be free-floating functions.
Once you do this, you will realize that there is a lot of stuff missing from your class as it does not expose the interface required to implement these simple cases.