Session Types in C++Abstraction • Documentation • Efficiency • Expressivity • Detecting errors • Doing something (by accident) that does not “fit” the type will be detected as error. 24What are types used for in programming0 码力 | 89 页 | 1.55 MB | 6 月前3
Back to Basics - Function Call Resolutionb.actual_str); } Unfortunately, it’s still possible to use std::swapwith Saks::strings by accident… 75 The std::swap Two-Step For example, here’s another type Personwith a custom swapfunction0 码力 | 44 页 | 1.30 MB | 6 月前3
Hiding Your Implementation Details is Not So Simpleprivates is wrong Data members should be private std::pair.first, std::pair.second => is a language accident… Why? Because it doesn’t properly allow different behaviors, e.g. a pair initialized with a single0 码力 | 145 页 | 2.45 MB | 6 月前3
Performance MattersDataHeapType* _theDataHeap = new (buf) DataHeapType; return _theDataHeap; } Or was it an accident?Why is faster than ? A′ A int main(int argc, char **argv) { topFrame = (voi0 码力 | 197 页 | 11.90 MB | 6 月前3
Better Code: Contractsbecomes a necessary design tool. (A beautiful example of this method is given in Chapter 9.) It is an accident of history that the work on operation decomposition preceded that on data representation. How unfor-0 码力 | 204 页 | 4.46 MB | 6 月前3
共 5 条
- 1













