原创 C++ Tips: 標準庫概覽
3.1 不要像重新發明車輪那樣企圖做每件事,去使用庫。 <<Effective STL>>包含了關於如何使用STL的很多寶貴建議。如Item 13解釋了爲什麼vector和string優先於動態的數組。Item 43解釋了算法調用優
原创 C++ Tips: 指針、數組和結構
5.1 避免非平凡的指針算術。 複雜的指針算術通常不必要,最好避免。原因是可能導致未定義的結果。兩個指針指向同一個數組的元素時,指針相減纔有意義。指針加上或者減去一個整數,得到的結果還是一個指針,如果這個值不指向原來指針指向的數組的元素,
原创 EXCEPTION HANDLING:A FALSE SENSE OF SECURITY
EXCEPTION HANDLING:A FALSE SENSE OF SECURITY by Tom Cargill This article first appeared in C++ Report, Volume 6, Nu
原创 VS2008 到 VS2010 STL關聯容器set 的一點變化
VS2008 到 VS2010 STL關聯容器set 的一點變化 最近在把項目從vs2008移植vs2010的時候, 發現在vs2008下編譯通過的代碼卻在vs2010編譯時出現錯誤。下面是代碼的一個簡化的示例: vector<int
原创 How a C++ compiler implements exception handling
Introduction One of the revolutionary features of C++ over traditional languages is its support for exception handling.
原创 C++ 程序庫介紹
以下內容轉帖自 http://www.uml.org.cn/c%2B%2B/200612015.htm 標準庫 標準庫中提供了C++程序的基本設施。雖然C++標準庫隨着C++標準折騰了許多年,直到標準的出臺才正式定型,但是在標準庫的實現
原创 Beej's 網絡編程指南
Beej's 網絡編程指南 Internet SocketsVersion 1.5.5 (13-Jan-1999)[http://www.ecst.csuchico.edu/~beej/guide/net] 原著:Brian "Bee
原创 C++ Links
Free C/C++ Compilers GCC http://gcc.gnu.org/install/binaries.html MinGW http://www.mingw.org/ Cygwin (GNU + c
原创 Member Function Pointers and the Fastest Possible C++ Delegates
Introduction Standard C++ does not have true object-oriented function pointers. This is unfortunate, because object-ori
原创 Expression Templates
Expression Templates Todd Veldhuizen Abstract: Expression Templates is a C++ technique for passing expressions as func
原创 Exception-Safety in Generic Components
Exception-Safety in Generic Components Lessons Learned from Specifying Exception-Safety for the C++ Standard Library D
原创 Programming in C++, Rules and Recommendations
Programming in C++, Rules and Recommendations By Mats Henricson and Erik Nyquist. Original translation from Swedish by
原创 用DEV-C++編譯BOOST
首先,下載DEV-C++,網址是http://www.bloodshed.net/dev/devcpp.html,目前最新版本是4.9.9.2。然後安裝DEV-C++。 接下來,有兩種方法可以得到BOOST的二進制庫文件。 第一種比
原创 Visual Studio 2010 STL的一個bug導致內存泄露
Visual Studio 2010 STL的一個bug導致內存泄露 隨着C++ 0x離我們越來越近,Visual Studio 2010已經支持了很多C++0x的語言特性並且改寫了STL的實現來支持這些特性。這裏有一個Stephan
原创 C++ Tips: 類型和聲明
4.1 保持較小的作用域。 保持較小的作用域有助於避免一些難以發現的錯誤。 C++支持在for循環和if語句中直接聲明變量,如: for (int i=0; i<100;i++){} if (