• <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

            學習也是一種樂趣
            <2025年5月>
            27282930123
            45678910
            11121314151617
            18192021222324
            25262728293031
            1234567

            統計

            • 隨筆 - 4
            • 文章 - 4
            • 評論 - 4
            • 引用 - 0

            常用鏈接

            留言簿(1)

            隨筆檔案

            文章分類

            文章檔案

            收藏夾

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            2007年5月8日

            遍歷刪除vector的中的元素

            一般來說vector不適合做經常刪除的容器,但是在某些情況下,我們確實需要刪除vector的部分元素,一般的方式類為v.erase(remove_if(v.begin(), v.end(), func)).但是本人懶的把操做寫到另一個函數中,下面是一個更好的辦法

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

            其中reverse_iterator和iterator的關系與轉換是關鍵,STL真是設計的強大.

            posted @ 2007-05-08 10:43 陳長虹 閱讀(5798) | 評論 (4)編輯 收藏

            2007年3月31日

            一個VIM的腳本

            使用VIM編寫程序,發現切換頭文件和代碼文件很麻煩,發現一個好東西A.vim,具體使用參數如下:
            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/就可以了,如果啟動時候有錯誤,就下載一個老一點的版本.

            posted @ 2007-03-31 10:26 陳長虹 閱讀(431) | 評論 (0)編輯 收藏
            indent工具參數

            indent是一個常用的Linux的C代碼格式化工具,但是參數太多,很難記憶,目前發現一組參數,可以格式化為我常用的代碼格式.

            -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,就是默認的indent參數了.

            posted @ 2007-03-31 10:12 陳長虹 閱讀(1025) | 評論 (0)編輯 收藏

            2007年3月12日

            開張了

            從Google上發現了這個C++專門的Blog,發現很不錯,有自己寫的欲望了,申請了一下,今天開張,希望能記錄一些經驗,保存一些自己看到的比較好的文章.

            posted @ 2007-03-12 15:20 陳長虹 閱讀(911) | 評論 (0)編輯 收藏
            僅列出標題  
            青青青国产精品国产精品久久久久| 99久久精品国产高清一区二区| 久久久久国产一区二区| 久久久久久久综合狠狠综合| 久久精品国产亚洲精品2020| 久久福利片| 久久精品国产亚洲av麻豆小说| 99久久国产主播综合精品| 久久久国产打桩机| 2020最新久久久视精品爱 | 久久精品九九亚洲精品| 久久精品国产亚洲av瑜伽| 国产亚洲欧美精品久久久| 久久久久亚洲精品无码网址| 国产精品久久久福利| 狼狼综合久久久久综合网| 欧美午夜A∨大片久久| 91精品国产91久久久久久蜜臀 | 精品国产91久久久久久久| 精品久久久一二三区| 国产午夜电影久久| 国产V亚洲V天堂无码久久久| 99久久夜色精品国产网站| 亚洲国产精品无码久久青草| 久久久久亚洲AV无码去区首| 久久精品国产亚洲麻豆| 韩国免费A级毛片久久| 亚洲中文字幕无码久久精品1| 久久久久久久久久久免费精品| 久久99精品国产99久久| 久久精品人人槡人妻人人玩AV| 色综合久久综合中文综合网| 2021久久精品免费观看| 亚洲国产成人精品久久久国产成人一区二区三区综 | 亚洲中文字幕久久精品无码喷水| 午夜视频久久久久一区 | 精品少妇人妻av无码久久| 国色天香久久久久久久小说| 国产成人无码精品久久久性色 | 亚洲国产精品久久久天堂 | 久久精品国产只有精品66|