跳轉到內容

更多 C++ 習語

75% developed
來自華夏公益教科書
More C++ Idioms C++ 確實已經變得太“專家友好”了 -- Bjarne Stroustrup,程式設計問題,技術評論,2006 年 11 月。

Stroustrup 的說法是正確的,因為專家非常熟悉該語言中的習語。 隨著程式設計師理解的習語數量的增加,該語言對他們來說變得更加友好。 這本開放內容書籍的目的是向對 C++ 有中等了解的程式設計師介紹現代 C++ 習語,並幫助提高他們的知識,使 C++ 對他們來說感覺更加友好。 它旨在成為專家 C++ 程式設計師在使用 C++ 進行程式設計或設計時經常使用的可重用習語的詳盡目錄。 這項工作旨在將他們的技術和詞彙彙集到一個單一作品中。 本書以簡潔的格式描述了習語:名稱-意圖-動機-解決方案-參考,這簡潔明瞭,有助於加快學習速度。 由於其本質,習語往往在 C++ 社群和出版物中多次出現。 我們盡力參考原始來源,如果發現參考不完整或不正確,請隨時建議或改進。

歡迎世界將可重用的 C++ 知識片段編目(類似於 GoF 關於設計模式的書籍)。 這裡的目標是首先建立一個現代 C++ 習語的詳盡目錄,然後將其發展成為一種習語語言,就像一種模式語言一樣。 最後,本書的內容可以在GNU 自由文件許可證的條款下重新發布。

面向:任何具有 C++ 和支援語言正規化中級知識的人

更多資訊

[編輯 | 編輯原始碼]

作者 | 讚賞 | 作者指南 | GNU 自由文件許可證

RSS Logo

更多 C++ 習語最近更改 RSS 2.0




注意:每個習語的同義詞列在括號中。

  1. 無環訪問者模式 TODO
  2. 取地址 75% developed  as of 9 October 2011
  3. 代數層次結構 75% developed  as of 12 June 2008
  4. 透過初始化附加 75% developed  as of 22 October 2011
  5. 律師-客戶 75% developed  as of 9 October 2011
  6. Barton-Nackman 技巧 75% developed  as of 21 February 2011
  7. 從成員派生基類 75% developed  as of 6 August 2007
  8. Boost 變異體 75% developed  as of 9 May 2010
  9. 在初始化期間呼叫虛擬函式 75% developed  as of 6 August 2007
  10. 功能查詢 100% developed  as of 21 February 2011
  11. 檢查刪除 75% developed  as of 15 August 2007
  12. 清除和最小化 75% developed  as of 10 August 2007
  13. 透過成員模板強制轉換 100% developed  as of 14 August 2007
  14. 計算建構函式 75% developed  as of 9 October 2011
  15. 具體資料型別 75% developed  as of 17 March 2008
  16. 第一次使用時構造 75% developed  as of 6 August 2007
  17. 構造跟蹤器 75% developed  as of 6 August 2007
  18. 複製-交換 75% developed  as of 10 August 2007
  19. 寫時複製 100% developed  as of 20 May 2009
  20. 執行緒安全的寫時複製 100% developed  as of 20 May 2009
  21. 侵入式引用計數(計數主體) 75% developed  as of 16 November 2007
  22. 協變返回型別 TODO
  23. 奇異遞迴模板模式(CRTP) 100% developed  as of 7 June 2024
  24. 棄用和刪除 TODO
  25. 空基最佳化(EBO) 75% developed  as of 9 October 2011
  26. enable-if 75% developed  as of 21 Feb 2011
  27. 擦除-移除 75% developed  as of 17 November 2007
  28. 執行繞過指標 75% developed  as of 6 August 2007
  29. 爆炸返回型別 TODO
  30. 匯出保護宏 TODO
  31. 表示式模板 75% developed  as of 6 August 2007
  32. 偽虛表 TODO
  33. 快速PIMPL 0% developed  as of 6 August 2007 TODO
  34. 最終類 75% developed  as of 10 May 2010
  35. 自由函式分配器75% developed  as of 18 June 2014
  36. 函式物件 TODO
  37. 函式中毒 TODO
  38. 泛型容器習語 75% developed  as of 22 November 2007
  39. 層次結構生成 TODO
  40. 隱式轉換 TODO
  41. 包含保護宏 75% developed  as of 3 November 2007
  42. 內聯保護宏 75% developed  as of 3 November 2007
  43. 內部類 75% developed  as of 31 August 2007
  44. Int-To-Type 75% developed  as of 21 September 2008
  45. 介面類 75% developed  as of 6 January 2008
  46. 迭代器對 100% developed  as of 28 October 2007
  47. 結識新朋友 75% developed  as of 5 January 2008
  48. 元函式 75% developed  as of 15 September 2008
  49. 移動建構函式 100% developed  as of 13 August 2007
  50. 多語句宏 75% developed  as of 16 February 2008
  51. 成員檢測器 75% developed  as of 10 May 2010
  52. 命名建構函式 75% developed  as of 28 September 2008
  53. 命名外部引數 TODO
  54. 命名迴圈(帶標籤的迴圈) 75% developed  as of 9 May 2010
  55. 命名引數 75% developed  as of 11 May 2010
  56. 命名模板引數 TODO
  57. 巧妙計數器(Schwarz 計數器) 75% developed  as of 6 August 2007
  58. 不可複製混合 75% developed  as of 6 August 2007
  59. 非成員非友元函式 0% developed  as of 10 March 2008 TODO
  60. 非丟擲交換 75% developed  as of 9 January 2008
  61. 非虛介面(NVI,公共過載非虛呼叫受保護非過載虛擬函式) 75% developed  as of 12 June 2008
  62. nullptr 75% developed  as of 3 November 2007
  63. 物件生成器 75% developed  as of 14 September 2008
  64. 物件模板 TODO
  65. 引數化基類(引數化繼承) 75% developed  as of 6 August 2007
  66. Pimpl(控制代碼體、編譯防火牆、柴郡貓) 0% developed  as of 2 March 2011
  67. 策略克隆(元函式包裝器) 100% developed  as of 14 August 2007
  68. 基於策略的設計 TODO
  69. 多型異常 75% developed  as of 28 September 2008
  70. 多型值型別 75% developed  as of 21 June 2024
  71. 遞迴型別組合 TODO
  72. 要求或禁止基於堆的物件
  73. 資源獲取即初始化(RAII,執行繞過物件,作用域鎖定) 100% developed  as of 6 November 2007
  74. 資源返回 75% developed  as of 3 November 2007
  75. 返回型別解析器 75% developed  as of 10 May 2010
  76. 執行時靜態初始化順序習慣用法 75% developed  as of 6 August 2007
  77. 安全布林值 75% developed  as of 6 August 2007
  78. 範圍守衛 100% developed  as of 14 August 2007
  79. 替換失敗不是錯誤 (SFINAE) 75% developed  as of 12 May 2012
  80. 縮短長模板名稱 待辦事項
  81. 縮小到適合 75% developed  as of 10 August 2007
  82. 小物件最佳化 待辦事項
  83. 智慧指標 75% developed  as of 17 November 2007
  84. 儲存類跟蹤器 待辦事項
  85. 標籤分派 50% developed  as of 20 June 2024
  86. 臨時基類 75% developed  as of 6 August 2007
  87. 臨時代理 75% developed  as of 6 August 2007
  88. result_of 技術 待辦事項
  89. 薄模板 75% developed  as of 6 August 2007
  90. 執行緒安全介面 待辦事項
  91. 特性 75% developed  as of 20 June 2024
  92. 型別擦除 75% developed  as of 4 February 2015
  93. 型別生成器 (模板型別定義) 75% developed  as of 14 September 2008
  94. 型別安全列舉 75% developed  as of 11 May 2010
  95. 型別選擇 75% developed  as of 9 May 2010
  96. 虛建構函式 75% developed  as of 17 March 2008
  97. 虛友元函式 75% developed  as of 10 May 2010

高階習慣用法

[edit | edit source]

以下是一些更高階的 C++ 習慣用法。

  1. 信封模式 75% developed  as of 1 February 2008 待辦事項


已棄用的習慣用法

[edit | edit source]
  1. Const auto_ptr 75% developed  as of 15 August 2007


華夏公益教科書開發階段
稀疏文字 0% 正在開發的文字 25% 成熟文字 50% 已開發文字 75% 綜合文字 100%
華夏公益教科書