What is the right way of initializing a static map? Do we need a static function that will initialize it?
C++ – Initializing a static std::map in C++
cstdmapstl
Related Topic
- C++ – When should static_cast, dynamic_cast, const_cast and reinterpret_cast be used
- C++ – The Definitive C++ Book Guide and List
- C++ – Why is “using namespace std;” considered bad practice
- C++ – the easiest way to initialize a std::vector with hardcoded elements
- C++ – The Rule of Three
- C++ – Easiest way to convert int to string in C++
- Java – Why is processing a sorted array faster than processing an unsorted array
- C++ – use a pointer rather than the object itself
Best Answer
Using C++11:
Using Boost.Assign: