<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Oo緣來是你oO


    posts - 120,comments - 125,trackbacks - 0
    Item 1:View C++ as a federation of languages
    ?
    Item 1:將C++視為語言的聯合體
    ?
    ------------------- Chinese -------------------
    ?
    最初,C++僅僅是在C的基礎上附加了一些面向對象的特征。但是,隨著C++的成長發展,C++已經成為了一個多范式的編程語言,一個囊括了過程化,面向對象,函數化,泛型以及元編程特性的聯合體。可以將它分成4個部分:
    ?
    C ------ 歸根結底,C++依然是基于C的。模塊,語句,預處理器,內建數據類型,數組,指針等,全都來自于C。只是在很多方面,C++提出了更高級的解決問題的方法。
    ?
    Object-Oriented C++ ------ C++的這部分就是C with Classes 涉及到的全部:類(包括構造函數和析構函數),封裝,繼承,多態,虛函數(動態邦定)等。C++的這一部分直接適用于面向對象設計的經典規則。
    ?
    Template C++ ------ 這是C++的泛型編程部分。
    ?
    STL ------ STL是一個特殊的模板庫。它將容器,迭代器,算法和函數對象優雅的整合在一起。
    ?????
    頭腦中保持這四個子語言,從一種子語言轉到另一種時,為了高效編程,需要改變策略:
    ?
    ????? 例如,適用內建(類C的)類型時,傳值通常比傳引用更高效,但是當從C++的C部分轉到C++的Object-Oriented部分,用戶自定義構造函數和析構函數意味著更好的做法是將引用傳遞給const參數。在 Template C++ 中工作時,這一點更加重要,因為,在這種情況下,你甚至不知道你的操作涉及到的對象的類型。當你進入 STL,無論如何,你知道迭代器和函數對象以 C 的指針為原型,對于 STL 中的迭代器和函數對象,古老的 C 中的傳值規則又重新生效。
    ?
    ***********************************************************
    ?
    Things to Remember:
    ?
    ????? 高效C++編程規則的變化,依賴于你使用C++的哪一個部分。
    ?
    ?
    ?
    ?
    ?
    ------------------- English --------------------
    ?
    In the beginning, C++ was just C with some object-oriented features tacked on. As the language matured, C++?have become a multiparadigm programming language, one suppoting a combination of procedural, object-oriented, functional, generic, and metaprogramming features.
    ?
    There are four parts in the C++:
    ?
    C ------ Way down deep, C++ is still based on C. Blocks, statements, the preprocessor, built-in data types, arrays, pointers,etc, all come from C. In many cases, C++ just offers approaches to problems that are superior to their C counterparts.
    ?
    Object-Oriented C++ ------ This part of C++ is what C with Classes was all about: classes(including constructors and destructors), encapsulation, inheritance, polymorphism, virtual functions(dynamic binding),etc. This is the part of C++ to which the classic rules for object-oriented design most directly apply.
    ?
    Template C++ ------ This is the generic programming part of C++.
    ?
    The STL ------ The STL si avery special template library. Its conventions regarding containers, iterators, algorithms, and function objects mesh beautifully.
    ?
    Keep these four sublanguages in mind, and don't be surprised when you encounter situations where effective programming requires that you change strategy when you switch from one sublanguage to another.
    ?
    For example, pass-by-value is generally more efficient than pass-by-reference for built-in (i.e., C-like) types, but when you move from the C part of C++ to Object-Oriented C++, the existence of user-defined constructors and destructors means that pass-by-reference-to-const is usually better. This is especially the case when working in Template C++, because there, you don't even know the type of object you're dealing with. When you cross into the STL, however, you know that iterators and function objects are modeled on pointers in C, so for iterators and function objects in the STL, the old C pass-by-value rule applies again.??
    ?
    **********************************************************
    ?
    Things to Remember
    ?
    Rules for effective C++ programming vary, depending on the part of C++ you are using!


    馬嘉楠
    jianan.ma@gmail.com

    posted on 2006-08-21 12:56 馬嘉楠 閱讀(360) 評論(0)  編輯  收藏 所屬分類: 經典 C++
    主站蜘蛛池模板: 亚洲人成色7777在线观看不卡 | 国产亚洲sss在线播放| 国产在线精品观看免费观看| 亚洲区日韩区无码区| 亚洲欧美日韩中文二区| 成年美女黄网站18禁免费| 亚洲制服在线观看| 国产福利在线免费| 国产免费牲交视频| 亚洲AV无码乱码在线观看性色扶 | 国产成人99久久亚洲综合精品 | 国产一卡2卡3卡4卡2021免费观看 国产一卡2卡3卡4卡无卡免费视频 | 国产一区二区三区在线免费| 亚洲欧美日韩国产精品一区| 午夜高清免费在线观看| 亚洲av无码片vr一区二区三区 | 亚洲国产精品日韩在线观看| 美女隐私免费视频看| 亚洲精品和日本精品| 热99RE久久精品这里都是精品免费| 狠狠色伊人亚洲综合成人| 特级无码毛片免费视频尤物| 亚洲精品美女视频| 午夜影视在线免费观看| 亚洲国产精品VA在线看黑人| 精品无码AV无码免费专区| 亚洲精品综合在线影院| 亚洲精品高清一二区久久| 久久er国产精品免费观看2| 亚洲av日韩片在线观看| ASS亚洲熟妇毛茸茸PICS| 国产成人免费永久播放视频平台| 男女猛烈激情xx00免费视频| 国产免费毛不卡片| 免费一级毛suv好看的国产网站| 亚洲中文字幕无码久久精品1| 蜜臀AV免费一区二区三区| 亚洲国产精品久久久久| 我要看WWW免费看插插视频| 国产99久久久久久免费看| 久久亚洲国产精品成人AV秋霞|