Question: What is the right way of initializing a static map? Do we need a static function that will initialize it?

Answer: 
Using C++11:

```
#include <map>
using namespace std;

map<int, char> m = {{1, 'a'}, {3, 'b'}, {5, 'c'}, {7, 'd'}};

```

Using [Boost.Assign](http://www.boost.org/doc/libs/1_36_0/libs/assign/doc/index.html):

```
#include <map>
#include "boost/assign.hpp"
using namespace std;
using namespace boost::assign;

map<int, char> m = map_list_of (1, 'a') (3, 'b') (5, 'c') (7, 'd');

```
You can try:

```
std::map <int, int> mymap = 
{
        std::pair <int, int> (1, 1),
        std::pair <int, int> (2, 2),
        std::pair <int, int> (2, 2)
};

```