天天看點

C++11 FAQ中文版--轉

更新至英文版October 3, 2012

譯者前言:

經過C++标準委員會的不懈努力,最新的ISO C++标準C++11,也即是原來的C++0x,已經正式釋出了。讓我們歡迎C++11!

當然,我也非常歡迎大家指出翻譯中的錯誤,或者是加入進來和我一起翻譯這份文檔,共同為C++11在中國的推廣做一點事情。你可以通過chenlq at live.com聯系到我。

對自己的翻譯做一點說明:

在翻譯的過程中,盡量遵照原文含義,可能有時候也會自己根據自己的了解加一點批注,希望可以幫助大家了解。

另外,雖然C++11剛剛公布,但是現在已經有很多編譯器支援C++11中一些相對比較獨立的特性,比如gcc以及它在Windows下的MinGW,Visual C++ 2012也部分支援,大家可以使用這三款編譯器嘗試這個文檔中的部分例子。

在下面的目錄中,已經翻譯的問題連結到相應的中文文檔,未翻譯的問題則連結到英文原文。

感謝所有參與翻譯的志願者(排名不分先後):interma,Chilli,張潇,dabaidu,Yibo Zhu,lianggang jiang,nivo,陳良喬

感謝所有參與審閱與校譯的志願者: ufouser

最後,祝大家閱讀愉快:)

—————————————————————————

目錄

<a href="http://www.chenlq.net/books/cpp11-faq/license-of-the-cpp11-faq-chinese-version-by-mr-stroustrups.html">Stroustrup先生關于中文版的授權許可郵件</a>

<a href="http://www.chenlq.net/books/cpp11-faq/notes-on-the-chinese-version-of-cpp11-faq-by-mr-stroustrup.html">Stroustrup先生關于C++11 FAQ的一些說明</a>

關于C++11的一般性的問題:

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-your-version-of-cpp11.html">您是如何看待C++11的?</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-when-will-cpp0x-become-a-formal-standard.html">什麼時候C++11會成為一部正式的标準呢?</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-when-will-compilers-implements-the-cpp11-standard.html">編譯器何時将會實作C++11标準呢?</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-when-can-we-use-new-standard-library-files.html">我們何時可以用到新的标準庫檔案?</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-goals.html">C++11努力要達到的目标有哪些?</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-what-is-the-specific-design-goals-for-the-guidance-of-the-standards-committee.html">指導标準委員會的具體設計目标是什麼?</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-11-faq-chinese-version-where-can-i-find-the-report-of-the-standards-committee.html">在哪裡可以找到标準委員會的報告?</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-11-faq-chinese-version-where-can-i-get-the-c-11-academic-and-technical-reference-materials.html">從哪裡可以獲得有關C++0x的學術性和技術性的參考資料?</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-where-can-i-read-about-c-0-x.html">還有哪些地方我可以讀到關于C++11的資料?</a>

<a href="http://www.chenlq.net/books/cpp11-faq/chinese-version-of-c-11-faq-video-on-the-c-11.html">有關于C++11的視訊嗎?</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-c-0-x-is-difficult-to-learn-anything.html">C++11難學嗎?</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-how-does-the-standard-committee-run.html">标準委員會是如何運作的?</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-who-is-the-standards-committee.html">誰在标準委員會裡?</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-achieving-c-0-x-features-in-what-order.html">實作者應以什麼順序提供C++11特性?</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-it-will-be-the-c-1-x.html">将會是C++1x嗎?</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-standard-concepts-what.html">标準中的”concepts”怎麼了?</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-you-do-not-like-c-features.html">有你不喜歡的C++特性嗎?</a>

關于獨立的語言特性的問題:

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-__cplusplus-macro.html">__cplusplus宏</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-alignment-alignment.html">alignment(對齊方式)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-attributes.html">attributes(屬性)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-atomic-operations.html">atomic operations</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-auto-set-data-types-during-initialization.html">auto——從初始化中推斷資料類型</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-c99-features.html">C99功能特性</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-enum-class-and-strongly-typed-enum.html">枚舉類——具有類域和強類型的枚舉</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-attributes.html">[[carries_dependency]]</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-copy-and-rethrow-exception.html">複制和重新抛出異常</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-constexpr.html">常量表達式(constexpr)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-decltype.html">decltype – 推斷表達式的資料類型</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-the-0-xfaq-chinese-version-control-the-default-function-default-or-disabled.html">控制預設函數——預設或者禁用函數</a>

<a href="http://www.chenlq.net/books/cpp11-faq/control-the-default-function-the-move-move-or-copy-the-copy.html">控制預設函數——移動(move)或者複制(copy)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-delegate-constructors.html">委托構造函數(Delegating constructors)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-concurrency-dynamic-initialization-and-destructor.html">并發性動态初始化和析構</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-xfaq-chinese-version-noexcept-to-prevent-the-abnormal-spread-and-diffusion.html">noexcept – 阻止異常的傳播與擴散</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-explicit-conversion-operator.html">顯式轉換操作符</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-extended-integer.html">擴充整型</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-external-template-declaration.html">外部模闆聲明</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-sequence-for-loop.html">序列for循環語句</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-return-type-after-syntax.html">傳回值類型後置文法</a>

<a href="http://www.chenlq.net/books/cpp11-faq/within-the-c-0-x-faq-chinese-version-class-member-initialization.html">類成員的内部初始化</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-inheriting-the-constructor.html">繼承的構造函數(inherited constructors)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-initializer-list.html">初始化清單</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-lambdas.html">Lambdas</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-local-type-in-template-parameters.html">用作模闆參數的局部類型</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-long-long-integer-type.html">long long(長長整數類型)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-memory-model.html">記憶體模型</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-prevent-the-narrowing-conversion.html">預防窄轉換</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-attributes.html">[[noreturn]]</a>

<a href="http://www.chenlq.net/think-talk-write/c-0-x-faq-chinese-version-nullptr-null-pointer-identifies.html">nullptr——空指針辨別</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-xfaq-chinese-version-control-of-overloading-the-override-override.html">對重載(override)的控制: override</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-xfaq-chinese-version-of-control-of-overloading-the-override-final.html">對重載(override)的控制:final</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-pod.html">PODs</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-of-native-string-that-identifies-the.html">原生字元串辨別</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-right-corner-of-the-brackets.html">右角括号</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-an-an-rvalue-references.html">右值引用</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-11-faq-chinese-version-simple-sfinae-rule.html">Simple SFINAE rule</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-static-assertions-compile-static_assert.html">靜态(編譯期)斷言 — static_assert</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-template-aliases-official-name-for-typedef-for-the-template.html">模闆别名(正式的名稱為”template typedef”)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-thread-local-storage-thread_local.html">線程本地化存儲 (thread_local)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-unicode-character.html">unicode字元</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-unified-initialization-syntax-and-semantics.html">統一初始化的文法和語義</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-broadly-defined-of-the-ss-commonwealth.html">(廣義的)聯合體</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-user-defined-literals.html">使用者定義資料辨別(User-defined literals)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-variadic-templates.html">可變參數模闆(Variadic Templates)</a>

我經常從提案中借用一些例子。是以,我要感謝這些提案的作者們。另外,我也從自己的訪談和論文中借用了很多例子。

關于标準庫的問題:

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-abandoning-a-process.html">abandoning_a_process</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-improvements-in-algorithm.html">算法方面的改進</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-array.html">array(數組)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-async.html">async()函數</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-atomic-operations.html">atomic_operations</a>

<a href="http://www.chenlq.net/books/cpp11-faq/chinese-version-of-c-11-faq-condition-variable.html">Condition variables(條件變量)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-improvements-of-the-standard-library-containers.html">容器(Container)方面的改進</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-std-function-and-std-bind.html">std::function 和 std::bind</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-std-future-and-the-the-std-promise.html">future and promise</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-garbage-collection.html">垃圾回收(應用程式二進制接口)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-unordered-containers.html">無序容器(Unordered containers)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-lock.html">鎖(locks)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-metaprogramming-and-type-the-traits.html">metaprogramming(元程式設計) and type traits</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-exclusive.html">互斥</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-11-faq-chinese-version-the-generation-of-random-numbers.html">随機數的産生</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-the-regular-expression-regular-expressions.html">正規表達式(Regular expressions)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/chinese-version-of-c-11-the-faq-the-scope-of-the-memory-an-allocator.html">具有作用域的記憶體配置設定器</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-shared-smart-pointer-the-shared_ptr.html">共享資源的智能指針shared_ptr</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-0-x-faq-chinese-version-thread-the-thread.html">線程(thread)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/chinese-version-of-c-0-x-faq-the-time-utility.html">時間工具程式</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-standard-library-std-tuple.html">标準庫中的元組(std::tuple)</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-unique_ptr.html">unique_ptr</a>

<a href="http://www.chenlq.net/books/cpp11-faq/cpp11-faq-chinese-version-series-the-weak_ptr.html">weak_ptr</a>

<a href="http://www.chenlq.net/books/cpp11-faq/c-11-faq-chinese-version-system-error.html">system error</a>

繼續閱讀