Clang/LLVM: clang -dM -E -x c /dev/nullclang++ -dM -E -x c++ /dev/null GNU GCC/G++: gcc -dM -E -x c /dev/nullg++ -dM -E -x c++ /dev/null Hewlett-Packard C/aC++: cc -dM -E -x c /dev/nullaCC -dM -E -x c++ /dev/null IBM XL C/C++: xlc -qshowmacros -E /dev/nullxlc++ -qshowmacros -E /dev/null Intel ICC/ICPC: […]
Month: February 2019
Recompile and Test
When writing scripts or playing with new C++ language features I find it helpful if the code gets recompiled and executed as soon as I change a file in the source directory. I wrote a simple bash function that produces the desired effect and can be used independent of a […]
Access Private Members
Have you ever wondered if there is a standard conformant way to access a private member in C++. One could #define private publicor try to reinterpret_cast to a type with similar layout or violate the language in a similar way. So is there a better way to do it? The […]
Resize QEMU-Image
5GB are not enough for the root partition you have allocated for a VM? No problem! Lets fix it. You need to run all commands with root permissions and you need to change vm_image.qcow2 and /dev/vda to values that match your system. # all command need to be run as […]
Is there a `[“foo”,”bar”].join(” “)` in c++?
Recently i have been asked if there is python / javascript like join() in c++. Here is what it could look like: