• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            C/C++/Linux/Embedded

            學(xué)習(xí)也是一種樂(lè)趣
            <2025年8月>
            272829303112
            3456789
            10111213141516
            17181920212223
            24252627282930
            31123456

            統(tǒng)計(jì)

            • 隨筆 - 4
            • 文章 - 4
            • 評(píng)論 - 4
            • 引用 - 0

            常用鏈接

            留言簿(1)

            隨筆檔案

            文章分類(lèi)

            文章檔案

            收藏夾

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            2007年5月8日

            遍歷刪除vector的中的元素

            一般來(lái)說(shuō)vector不適合做經(jīng)常刪除的容器,但是在某些情況下,我們確實(shí)需要?jiǎng)h除vector的部分元素,一般的方式類(lèi)為v.erase(remove_if(v.begin(), v.end(), func)).但是本人懶的把操做寫(xiě)到另一個(gè)函數(shù)中,下面是一個(gè)更好的辦法

            vector<int>::reverse_iterator rit = v.rbegin();
            while (rit != v.rbegin())
            {
                
            if (func(*rit)) //檢查是否需要?jiǎng)h除
                    v.erase((++rit).base());
                
            else
                   
            ++rit;
            }

            其中reverse_iterator和iterator的關(guān)系與轉(zhuǎn)換是關(guān)鍵,STL真是設(shè)計(jì)的強(qiáng)大.

            posted @ 2007-05-08 10:43 陳長(zhǎng)虹 閱讀(5823) | 評(píng)論 (4)編輯 收藏

            2007年3月31日

            一個(gè)VIM的腳本

            使用VIM編寫(xiě)程序,發(fā)現(xiàn)切換頭文件和代碼文件很麻煩,發(fā)現(xiàn)一個(gè)好東西A.vim,具體使用參數(shù)如下:
            A switches to the header file corresponding to the current file being edited (or vise versa)
            :AS splits and switches
            :AV vertical splits and switches
            :AT new tab and switches
            :AN cycles through matches
            :IH switches to file under cursor
            :IHS splits and switches
            :IHV vertical splits and switches
            :IHT new tab and switches
            :IHN cycles through matches
            <Leader>ih switches to file under cursor
            <Leader>is switches to the alternate file of file under cursor (e.g. on??<foo.h> switches to foo.cpp)
            <Leader>ihn cycles through matches
            下載地址如下:http://www.vim.org/scripts/script.php?script_id=31
            下載后放到/usr/share/vim/vim61/plugin/就可以了,如果啟動(dòng)時(shí)候有錯(cuò)誤,就下載一個(gè)老一點(diǎn)的版本.

            posted @ 2007-03-31 10:26 陳長(zhǎng)虹 閱讀(441) | 評(píng)論 (0)編輯 收藏
            indent工具參數(shù)

            indent是一個(gè)常用的Linux的C代碼格式化工具,但是參數(shù)太多,很難記憶,目前發(fā)現(xiàn)一組參數(shù),可以格式化為我常用的代碼格式.

            -bad?-bap?-bbb?-bbo?-nbc?-bl?-bli0?-bls?-c33?-cd33?-ncdb?-ncdw?-nce?-cli0?-cp33?-cs?-d0?-nbfda??-nfc1?-nfca?-hnl?-ip5?-l75?-l
            p?
            -pcs?-nprs?-saf?-sai?-saw?-nsc?-nsob?-nss?-i4?-ts4?-ut
            保存在~/.indent.pro,就是默認(rèn)的indent參數(shù)了.

            posted @ 2007-03-31 10:12 陳長(zhǎng)虹 閱讀(1039) | 評(píng)論 (0)編輯 收藏

            2007年3月12日

            開(kāi)張了

            從Google上發(fā)現(xiàn)了這個(gè)C++專(zhuān)門(mén)的Blog,發(fā)現(xiàn)很不錯(cuò),有自己寫(xiě)的欲望了,申請(qǐng)了一下,今天開(kāi)張,希望能記錄一些經(jīng)驗(yàn),保存一些自己看到的比較好的文章.

            posted @ 2007-03-12 15:20 陳長(zhǎng)虹 閱讀(921) | 評(píng)論 (0)編輯 收藏
            僅列出標(biāo)題  
            久久免费高清视频| 亚洲精品高清久久| 99久久国产宗和精品1上映| 亚洲国产精品无码久久| 久久久久99精品成人片试看| 久久天堂电影网| 久久精品青青草原伊人| 久久er国产精品免费观看2| 伊人久久五月天| 精品无码久久久久久国产| 日韩精品无码久久久久久| 成人精品一区二区久久| 久久精品国产亚洲AV麻豆网站| 久久99精品国产麻豆婷婷| 国内精品人妻无码久久久影院 | 精品熟女少妇av免费久久| 国产日韩久久免费影院| 国产亚洲色婷婷久久99精品| 久久天天婷婷五月俺也去| 久久精品无码av| 国产亚洲精午夜久久久久久| a级成人毛片久久| 久久国产色AV免费观看| 18禁黄久久久AAA片| 久久亚洲欧洲国产综合| 国产精品美女久久久免费| 久久国产精品久久| 久久青青草原综合伊人| 狠狠色丁香久久综合五月| 99久久人妻无码精品系列蜜桃| 久久久无码精品亚洲日韩京东传媒 | 精品久久久久成人码免费动漫| 久久成人精品视频| 久久久久国产一级毛片高清版| 久久人人爽人人人人片av| av色综合久久天堂av色综合在| 亚洲国产日韩欧美综合久久| 久久久精品国产Sm最大网站| 久久国产福利免费| 久久婷婷五月综合色99啪ak| 四虎国产精品免费久久|