Introduction std::forward: Keeps the type of the reference. (lvalue, rvalue) concepts: Specify requirements for the template types. Example $ g++
Continue readingCategory: Development
Backward and Forward compatibility (API)
Showcase API (in protobuf) message User { string name = 1; int32 id = 2; } Backward compatibility If you
Continue readingCache friendly code
Example Analysis The array will be stored in memory like this: [row_0, col_0] … [row_0, col_999] … [row_999, col_0] …
Continue readingLayout of std::string (libstdc++)
Source code Analysis $ g++ –version g++ (Ubuntu 13.2.0-4ubuntu3) 13.2.0 $ g++ main.cpp -g $ gdb a.out (gdb) b 7
Continue readingVirtual vs. Template (C++)
Virtual Gets resolved at run-time, leading to a shorter compile-time. Template Gets resolved at compile-time, leading to a shorter run-time.
Continue readingLayout of std:set (libstdc++)
Source code Analysis $ g++ –version g++ (Ubuntu 13.2.0-4ubuntu3) 13.2.0 $ g++ main.cpp -g $ gdb a.out (gdb) b 6
Continue readingData structures – Time complexity (libstdc++)
Cases B … Best case A … Average case W … Worst case If there is nothing mentioned, it matches
Continue readingLayout of std::unordered_set (libstdc++)
Layout The meta element on the stack consumes 7 words (56 Byte on x64, 28 Byte on x86). Each node
Continue readingLayout of std:deque (libstdc++)
Layout The meta element on the stack consumes 10 words (80 Byte on x64, 40 Byte on x86). Each chunk
Continue reading