C++20 Low-level code often seeks to interpret objects of one type as another: keep the same bits, but obtain an object of a different type. Doing so correctly is error-prone: using reinterpret_cast or union runs afoul of type-aliasing rules yet these are the intuitive solutions developers mistakenly turn to. Attuned developers use aligned_storage with memcpy, […]
14.03.2019
C++ Guns: floating point bit round - p0476r2 Bit-casting object representations
06.03.2019
Profiler read/write miss Gedanken
Profiler read/write miss Gedanken write miss: unterscheiden zwischen permanenten und temporäre Daten: Permanente Daten: wohl unausweichlich, denn die neuen Daten MÜSSEN ja vom Chache in den Hauptspeicher geschrieben werden. Temporäre Daten: eventuell vermeidbar, wenn man sie an einer späteren Stelle im Code erstellt. Wann immer Daten in den Cache geschrieben werden, fliegen andere Daten raus […]
02.03.2019
C++ Guns: A Sorted Data Type
Mit dem C++ Typsystem ist es möglich Informationen und Algorithmen in das Programm zu codieren, die schon vor der Compilezeit fest stehen. Wie würdet ihr folgendes Problem lösen: Ein Algorithmus, zum Beispiel die binäre Suche, benötigt einen bereits sortieren Datensatz. Den Datensatz zu sortieren und danach die Suche anzuwenden ist trivial. Aber in einem anderen […]