C++, can I statically initialize a std::map at compile time?

It’s not exactly static initialization, but still, give it a try. If your compiler doesn’t support C++0x, I’d go for std::map’s iteration constructor: std::pair<int, std::string> map_data[] = { std::make_pair(1, “a”), std::make_pair(2, “b”), std::make_pair(3, “c”) }; std::map<int, std::string> my_map(map_data, map_data + sizeof map_data / sizeof map_data[0]); This is pretty readable, doesn’t require any extra libraries and … Read more

Embedded C++ : to use STL or not?

I work on real-time embedded systems every day. Of course, my definition of embedded system may be different than yours. But we make full use of the STL and exceptions and do not experience any unmanageable problems. We also make use of dynamic memory (at a very high rate; allocating lots of packets per second, … Read more

Compiling an application for use in highly radioactive environments

Working for about 4-5 years with software/firmware development and environment testing of miniaturized satellites*, I would like to share my experience here. *(miniaturized satellites are a lot more prone to single event upsets than bigger satellites due to its relatively small, limited sizes for its electronic components) To be very concise and direct: there is … Read more

Explaination of ARM (especifically mobile) Peripherals Addressing and Bus architecture?

A difference between ARM and the x86 is PIO. There are no special instruction on the ARM to access an I/O device. Everything is done through memory mapped I/O. A second difference is the ARM (and RISC in general) has a separate load/store unit(s) that are separate from normal logic. A third difference is that … Read more

tech