Initialization of static std::map<int, int> in C++: methods and examples
Hello everyone! I'm new to C++ and trying to understand STL containers. I have a class where I need to store a static mapping of numbers (int -> int), for example, a correspondence between error codes and their text identifiers. I want this map to be static, meaning shared across all instances of the class. The problem is that I can't figure out how to properly initialize such a static std::map.
Here's an example of my code:
```cpp
#include
No answers yet.
Log in to leave an answer
Blogs
Microservices in Rust: Architecture, Practice, and Code Examples