C++ Idioms

EuroPLoP(1998)

引用 35|浏览7
暂无评分
摘要
This paper attempts to do three things. The first is to re-cast the well-known idioms of Advanced C++ Programming Styles and Idioms [Coplien1992] in pattern form. The second is to organize these idioms, which until now have survived as independent and largely unrelated patterns, into a true pattern language. That means that the patterns form a graph and that they should be applied in an order dictated by the structure of the graph. The third goal is to show that the patterns together (as a pattern language) attack what is metaphorically, conceptually, or actually a structural problem. Structure is a central element in Alexander's theories of aesthetics, a perspective that pervades all his work but which has become more directly articulated in recent works such as Nature of Order. These patterns do piecemeal construction of the structure of an inheritance hierarchy and the structure of the classes within it. The paper tries to explore that geometric nature. Many thanks to Steve Berczuk who was the EuroPLoP '98 shepherd for this paper. This space left blank intentionally as a placeholder for words that we later find we want to define here! Overall, this pattern language deals with one aspect of C++ design: In particular, it deals with that aspect that focuses on algebraic types. C++ is rich in features that support algebraic types, including operator overloading and a good family of built-in numeric types. The idioms surrounding the algebraic view are strong enough that the tradition carries on in libraries for strings and other non-numeric types. There are many non-numeric and, properly, non-algebraic types to which many of these patterns may apply. There are also many inheritance hierarchies to which the algebraic patterns in particular are irrelevant; some times just don't have algebraic properties. The same is true even for patterns like Handle/Body (which apply largely to types that behave as built-in value types) and Counted Body (which is pertinent for Handle/Body instances with dynamically allocated resources). The Context and Forces sections of each pattern guide the reader in the appropriate application of these patterns to individual problems.
更多
查看译文
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要