锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久久97国产精华液好用吗,亚洲国产成人乱码精品女人久久久不卡,久久天天躁夜夜躁狠狠http://www.shnenglu.com/gaimor/archive/2010/12/29/137652.htmlccsdu2009ccsdu2009Wed, 29 Dec 2010 03:21:00 GMThttp://www.shnenglu.com/gaimor/archive/2010/12/29/137652.htmlhttp://www.shnenglu.com/gaimor/comments/137652.htmlhttp://www.shnenglu.com/gaimor/archive/2010/12/29/137652.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/137652.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/137652.html灝卞啓涓猚++鎺掑垪緇勫悎鍑芥暟鐨勪嬌鐢ㄥ惂
浠ュ悗浣跨敤寰楃潃鐨?br>
#include <iostream>
#include 
<vector>
#include 
<algorithm>
#include 
<boost/assign.hpp>
#include 
<boost/function.hpp>

using namespace std;
using namespace boost;
using namespace boost::assign;

inline 
void print_(int t){cout<<t<<" ";}
inline 
void print(vector<int>& vec)
{
    for_each(vec.begin(),vec.end(),print_);
    cout
<<endl;
}

//! 鍏ㄦ帓鍒楁祴璇?/span>
void test1()
{
    vector
<int> vec;
    vec 
+= 1,2,3,4,5,6,7,8;
    sort(vec.begin(),vec.end());
    
int i = 0;
    
do
    {
       print(vec);
       i
++;
    }
    
while(next_permutation(vec.begin(),vec.end()));
    std::cout
<<i<<std::endl;
}

//! 緇勫悎嫻嬭瘯
size_t test2(int n,int m,boost::function<void(std::vector<int>& vec)> fn)
{
    vector
<int> p,set;
    p.insert(p.end(),m,
1);
    p.insert(p.end(),n
-m,0);
    
for(int i = 0;i != p.size();++i)
        
set.push_back(i+1);
    vector
<int> vec;
    size_t cnt 
= 0;
    
do{
        
for(int i = 0;i != p.size();++i)
            
if(p[i])
               vec.push_back(
set[i]);
        fn(vec);
        cnt 
++;
        vec.clear();
    }
while(prev_permutation( p.begin(), p.end()));
    
return cnt;
}

int main()
{
    test1();
    std::cout
<<test2(20,3,print)<<std::endl;
    
return 0;
}
....................................................................................................................



ccsdu2009 2010-12-29 11:21 鍙戣〃璇勮
]]>
boost搴撲嬌鐢ㄦ敞鎰忎簨欏?1)-浠巄oost::tokenizer璇磋搗http://www.shnenglu.com/gaimor/archive/2010/11/19/134091.htmlccsdu2009ccsdu2009Fri, 19 Nov 2010 07:56:00 GMThttp://www.shnenglu.com/gaimor/archive/2010/11/19/134091.htmlhttp://www.shnenglu.com/gaimor/comments/134091.htmlhttp://www.shnenglu.com/gaimor/archive/2010/11/19/134091.html#Feedback12http://www.shnenglu.com/gaimor/comments/commentRss/134091.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/134091.html浣嗘槸騫朵笉鏄畬緹庣殑
鍦ㄤ嬌鐢ㄧ殑鏃跺欓渶瑕佽緇嗘敞鎰?br>
    std::string tag;
    boost::tokenizer
<> tok(std::string("鐚?nbsp;鐙?nbsp;鐚?/span>"));
    
for(boost::tokenizer<>::iterator beg=tok.begin();beg!=tok.end();++beg)
    {
        tag 
+= *beg;
        tag 
+= "+";
    }
    std::cout<<tag<<std::endl;
澶у璇磋緇撴灉鍚?br>


ccsdu2009 2010-11-19 15:56 鍙戣〃璇勮
]]>
boost涔?.shared_ptr娉ㄦ剰浜嬮」http://www.shnenglu.com/gaimor/archive/2010/10/27/131435.htmlccsdu2009ccsdu2009Wed, 27 Oct 2010 01:57:00 GMThttp://www.shnenglu.com/gaimor/archive/2010/10/27/131435.htmlhttp://www.shnenglu.com/gaimor/comments/131435.htmlhttp://www.shnenglu.com/gaimor/archive/2010/10/27/131435.html#Feedback6http://www.shnenglu.com/gaimor/comments/commentRss/131435.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/131435.html涓嶈繃榪欎釜鍋氱殑寰堜笉灝戒漢鎰?涓嶈繃娌″叧緋誨挶鎱㈡參鍋氬彧瑕佸潥鎸丱(∩_∩)O~)
涓涓棶棰樺氨鏄紩鎿庝腑鐨凴efPtr璁捐鏈夌偣闂
绱㈡т笅涓紩鎿庣増鏈氨鏄敤boost搴撳惂
鍏嶅緱涓浜涘熀紜闇瑕佽嚜宸卞啓

瑕佷嬌鐢╞oost搴撳叾涓殑鏅鴻兘鎸囬拡蹇呬笉鍙皯
鏋楁灄鎬繪繪湁濂藉嚑涓被鍨?br>涓嶈繃甯哥敤寰楄繕鏄?涓?br>scoped_ptr,
shared_ptr,
weak_ptr
榪欓噷鍏堣shared_ptr
瀹冭繕鏄紩鐢ㄨ鏁扮被鍨嬬殑鎸囬拡鍜?br>璨屼技姣旇緝濂界敤(浣嗘槸鏍規湰榪樻槸鍦ㄤ簬浣跨敤鐨勪漢)
涓轟簡姝g‘浣跨敤瀹冮渶瑕佹敞鎰忓嚑涓棶棰?br>1.澶氱嚎紼嬬幆澧冨拰寰幆寮曠敤
    搴旇閰嶅悎weak_ptr
2.浣跨敤浜唖hared_ptr灝變笉搴旇浣跨敤鍏朵粬鍐呭瓨綆$悊鏈哄埗
3.涓嶈鏋勯犱復鏃剁殑shared_tr浣滀負鍑芥暟鍙傛暟
4.鍏朵粬...
   



ccsdu2009 2010-10-27 09:57 鍙戣〃璇勮
]]>
boost涔?.boost鐨刾ool浣跨敤http://www.shnenglu.com/gaimor/archive/2010/08/15/123496.htmlccsdu2009ccsdu2009Sun, 15 Aug 2010 06:54:00 GMThttp://www.shnenglu.com/gaimor/archive/2010/08/15/123496.htmlhttp://www.shnenglu.com/gaimor/comments/123496.htmlhttp://www.shnenglu.com/gaimor/archive/2010/08/15/123496.html#Feedback1http://www.shnenglu.com/gaimor/comments/commentRss/123496.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/123496.html
#include <cstdlib>
#include 
<iostream>
#include 
<boost/pool/pool.hpp>
#include 
<boost/pool/object_pool.hpp>
using namespace std;
using namespace boost;

class Object
{
public:
    Object(){cout
<<"new obj"<<endl;}
    
~Object(){cout<<"delete obj"<<endl;}      
}; 

int main(int argc, char *argv[])
{   
    
//!姣忔鍒嗛厤鐨勫潡鐨勫ぇ灝?/span>
    const int blocksize = sizeof(int); 
    boost::pool
<> alloc(blocksize);
    
for(int i = 0; i < 100; i++)
    {   
        
//! 鍒嗛厤 
        int* ptr = (int*)alloc.malloc();
        cout
<<*ptr<<endl;
        
//! 閲婃斁     
        alloc.free(ptr);    
    }
    
    
//!object pool姣忔闇瑕佹寚瀹氬璞″ぇ灝?nbsp;
    boost::object_pool<Object> pool_alloc;
    
for(int i = 0;i < 100;i++)
    {   
        
//! 鍒嗛厤鍐呭瓨 
        void* mem = pool_alloc.malloc();
        
//! 鏋勯?/span>
        Object *obj = new(mem)Object(); 
        
//! 鏋愭瀯 
        pool_alloc.destroy(obj);
    }
  
    system(
"PAUSE");
    
return EXIT_SUCCESS;
}
//! ccsdu2004



ccsdu2009 2010-08-15 14:54 鍙戣〃璇勮
]]>
boost涔?.functionhttp://www.shnenglu.com/gaimor/archive/2010/08/14/123449.htmlccsdu2009ccsdu2009Sat, 14 Aug 2010 10:42:00 GMThttp://www.shnenglu.com/gaimor/archive/2010/08/14/123449.htmlhttp://www.shnenglu.com/gaimor/comments/123449.htmlhttp://www.shnenglu.com/gaimor/archive/2010/08/14/123449.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/123449.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/123449.html璁捐澶存枃浠?
#include <boost/function.hpp>

鍩烘湰鐨刦unction瀵硅薄渚嬪瓙
boost::function<int(const char*,&int)> f;
浠g爜璇ュ嚱瀛愬搴旂殑鍑芥暟鍏惰繑鍥炲間負int綾誨瀷,濂規湁涓?涓弬鏁板垎鍒負const char*鍜?amp;int綾誨瀷
涓涓畝鍗曠殑渚嬪瓙濡備笅鎵紺?
#include <iostream>
#include 
<boost/function.hpp>

inline 
int Sum(const int a,const int b)
{
    
return a + b;    
}

int main()
{   
    boost::function
<int(const int,const int)> sum_ptr;
    sum_ptr 
= &Sum;
    std::cout
<<"1+2=:?"<<sum_ptr(1,2);
    system(
"PAUSE");
    
return EXIT_SUCCESS;
}
濡傛灉瀵瑰簲鐨勫嚱鏁頒負綾葷殑鎴愬憳鍑芥暟鍒欏叾浣跨敤渚嬪瓙鍙弬鑰冧笅闈㈢殑璇存槑:
#include <iostream>
#include 
<boost/function.hpp>
#include 
<functional>

struct Adder 
{
    Adder(
int val):value(val){}
    
int Add(int x){return x*value;}
    
int value;
};

int main()
{   
    
//! 瀵瑰簲鍑芥暟榪斿洖鍊糹nt鍙傛暟涓篿nt
    boost::function<int(int)>f;
    Adder add(
7);
    
//! 緇戝畾鎴愬憳鍑芥暟鍒癰oost::function<>
    f = std::bind1st(std::mem_fun(&Adder::Add),&add);
    std::cout
<<f(5)<<std::endl; 

    
    system(
"PAUSE");
    
return EXIT_SUCCESS;
}
瀵逛簬浠垮嚱瀛愬垯鍙互榪欐牱鍋?
#include <iostream>
#include 
<boost/function.hpp>
#include 
<functional>

struct Div 
{
    
float operator()(int x, int y)const 
    {    
       
return((float)x)/y; 
    }
};

int main()
{   
    
//! 2
    boost::function<float(int,int)> div;
    div 
= Div();
    std::cout
<<div(1,2)<<std::endl;
    
    system(
"PAUSE");
    
return EXIT_SUCCESS;
}
//! ccsdu2004



ccsdu2009 2010-08-14 18:42 鍙戣〃璇勮
]]>
boost涔?.瀹瑰櫒璧嬪兼搷浣?/title><link>http://www.shnenglu.com/gaimor/archive/2010/08/12/123143.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Thu, 12 Aug 2010 01:55:00 GMT</pubDate><guid>http://www.shnenglu.com/gaimor/archive/2010/08/12/123143.html</guid><wfw:comment>http://www.shnenglu.com/gaimor/comments/123143.html</wfw:comment><comments>http://www.shnenglu.com/gaimor/archive/2010/08/12/123143.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/gaimor/comments/commentRss/123143.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/gaimor/services/trackbacks/123143.html</trackback:ping><description><![CDATA[榪欐槸浣跨敤Boost assigne灝忓簱鐨勪緥瀛?br>鍖呮嫭map,vector,array鐨勮祴鍊兼搷浣?br> <div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #000000;">#include </span><span style="color: #000000;"><</span><span style="color: #000000;">cstdlib</span><span style="color: #000000;">></span><span style="color: #000000;"><br>#include </span><span style="color: #000000;"><</span><span style="color: #000000;">iostream</span><span style="color: #000000;">></span><span style="color: #000000;"><br>#include </span><span style="color: #000000;"><</span><span style="color: #000000;">boost</span><span style="color: #000000;">/</span><span style="color: #000000;">assign.hpp</span><span style="color: #000000;">></span><span style="color: #000000;"><br>#include </span><span style="color: #000000;"><</span><span style="color: #000000;">boost</span><span style="color: #000000;">/</span><span style="color: #000000;">array.hpp</span><span style="color: #000000;">></span><span style="color: #000000;"><br>#include </span><span style="color: #000000;"><</span><span style="color: #000000;">algorithm</span><span style="color: #000000;">></span><span style="color: #000000;"><br>#include </span><span style="color: #000000;"><</span><span style="color: #000000;">iterator</span><span style="color: #000000;">></span><span style="color: #000000;"> <br><br></span><span style="color: #0000ff;">using</span><span style="color: #000000;"> </span><span style="color: #0000ff;">namespace</span><span style="color: #000000;"> std;<br></span><span style="color: #0000ff;">using</span><span style="color: #000000;"> </span><span style="color: #0000ff;">namespace</span><span style="color: #000000;"> boost;<br></span><span style="color: #0000ff;">using</span><span style="color: #000000;"> </span><span style="color: #0000ff;">namespace</span><span style="color: #000000;"> boost::assign;<br><br></span><span style="color: #0000ff;">int</span><span style="color: #000000;"> main(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> argc, </span><span style="color: #0000ff;">char</span><span style="color: #000000;"> </span><span style="color: #000000;">*</span><span style="color: #000000;">argv[])<br>{<br>    </span><span style="color: #008000;">//</span><span style="color: #008000;">! vector璧嬪?/span><span style="color: #008000;"><br></span><span style="color: #000000;">    vector</span><span style="color: #000000;"><</span><span style="color: #0000ff;">int</span><span style="color: #000000;">></span><span style="color: #000000;"> v;<br>    v </span><span style="color: #000000;">+=</span><span style="color: #000000;"> </span><span style="color: #000000;">1</span><span style="color: #000000;">,</span><span style="color: #000000;">2</span><span style="color: #000000;">,</span><span style="color: #000000;">3</span><span style="color: #000000;">,</span><span style="color: #000000;">4</span><span style="color: #000000;">,</span><span style="color: #000000;">5</span><span style="color: #000000;">,</span><span style="color: #000000;">6</span><span style="color: #000000;">,</span><span style="color: #000000;">7</span><span style="color: #000000;">,</span><span style="color: #000000;">8</span><span style="color: #000000;">,</span><span style="color: #000000;">9</span><span style="color: #000000;">; <br>    copy(v.begin(),v.end(),ostream_iterator</span><span style="color: #000000;"><</span><span style="color: #0000ff;">int</span><span style="color: #000000;">></span><span style="color: #000000;">(cout,</span><span style="color: #000000;">"</span><span style="color: #000000;">\n</span><span style="color: #000000;">"</span><span style="color: #000000;">));<br>    <br>    </span><span style="color: #008000;">//</span><span style="color: #008000;">! map</span><span style="color: #008000;"><br></span><span style="color: #000000;">    map</span><span style="color: #000000;"><</span><span style="color: #0000ff;">string</span><span style="color: #000000;">,</span><span style="color: #0000ff;">int</span><span style="color: #000000;">></span><span style="color: #000000;"> m;<br>    insert(m)(</span><span style="color: #000000;">"</span><span style="color: #000000;">foo</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">1</span><span style="color: #000000;">)(</span><span style="color: #000000;">"</span><span style="color: #000000;">bar</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">2</span><span style="color: #000000;">)(</span><span style="color: #000000;">"</span><span style="color: #000000;">ss</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">3</span><span style="color: #000000;">);<br>    std::cout</span><span style="color: #000000;"><<</span><span style="color: #000000;">m.size()</span><span style="color: #000000;"><<</span><span style="color: #000000;">std::endl;<br>    <br>    </span><span style="color: #008000;">//</span><span style="color: #008000;">! boost array.</span><span style="color: #008000;"><br></span><span style="color: #000000;">    typedef array</span><span style="color: #000000;"><</span><span style="color: #0000ff;">float</span><span style="color: #000000;">,</span><span style="color: #000000;">6</span><span style="color: #000000;">></span><span style="color: #000000;"> Array;<br></span><span style="color: #0000ff;">#if</span><span style="color: #000000;"> BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))   </span><span style="color: #000000;"><br>    Array a </span><span style="color: #000000;">=</span><span style="color: #000000;"> list_of(</span><span style="color: #000000;">1.1</span><span style="color: #000000;">)(</span><span style="color: #000000;">2.2</span><span style="color: #000000;">)(</span><span style="color: #000000;">3.3</span><span style="color: #000000;">)(</span><span style="color: #000000;">4.4</span><span style="color: #000000;">)(</span><span style="color: #000000;">5.5</span><span style="color: #000000;">)(</span><span style="color: #000000;">6.6</span><span style="color: #000000;">).to_array(a);<br></span><span style="color: #0000ff;">#else</span><span style="color: #000000;"><br>    Array a </span><span style="color: #000000;">=</span><span style="color: #000000;"> list_of(</span><span style="color: #000000;">1.1</span><span style="color: #000000;">)(</span><span style="color: #000000;">2.2</span><span style="color: #000000;">)(</span><span style="color: #000000;">3.3</span><span style="color: #000000;">)(</span><span style="color: #000000;">4.4</span><span style="color: #000000;">)(</span><span style="color: #000000;">5.5</span><span style="color: #000000;">)(</span><span style="color: #000000;">6.6</span><span style="color: #000000;">);<br></span><span style="color: #0000ff;">#endif</span><span style="color: #000000;"><br>    copy(a.begin(),a.end(),ostream_iterator</span><span style="color: #000000;"><</span><span style="color: #0000ff;">float</span><span style="color: #000000;">></span><span style="color: #000000;">(cout,</span><span style="color: #000000;">"</span><span style="color: #000000;">\n</span><span style="color: #000000;">"</span><span style="color: #000000;">));<br>    <br>    typedef boost::tuple</span><span style="color: #000000;"><</span><span style="color: #0000ff;">int</span><span style="color: #000000;">,std::</span><span style="color: #0000ff;">string</span><span style="color: #000000;">,</span><span style="color: #0000ff;">int</span><span style="color: #000000;">></span><span style="color: #000000;"> tuple;<br>    std::vector</span><span style="color: #000000;"><</span><span style="color: #000000;">tuple</span><span style="color: #000000;">></span><span style="color: #000000;"> vt </span><span style="color: #000000;">=</span><span style="color: #000000;"> tuple_list_of(</span><span style="color: #000000;">1</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">foo</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">2</span><span style="color: #000000;">)(</span><span style="color: #000000;">3</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">bar</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">4</span><span style="color: #000000;">);<br>    std::map</span><span style="color: #000000;"><</span><span style="color: #000000;">std::</span><span style="color: #0000ff;">string</span><span style="color: #000000;">,</span><span style="color: #0000ff;">int</span><span style="color: #000000;">></span><span style="color: #000000;"> mp </span><span style="color: #000000;">=</span><span style="color: #000000;"> pair_list_of(</span><span style="color: #000000;">"</span><span style="color: #000000;">foo</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">3</span><span style="color: #000000;">)(</span><span style="color: #000000;">"</span><span style="color: #000000;">bar</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">5</span><span style="color: #000000;">);<br>    <br>    system(</span><span style="color: #000000;">"</span><span style="color: #000000;">PAUSE</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br>    </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> EXIT_SUCCESS;<br>}<br></span><span style="color: #008000;">//</span><span style="color: #008000;">! ccsdu2004</span></div> <br><br><img src ="http://www.shnenglu.com/gaimor/aggbug/123143.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/gaimor/" target="_blank">ccsdu2009</a> 2010-08-12 09:55 <a href="http://www.shnenglu.com/gaimor/archive/2010/08/12/123143.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>boost涔?.鏂囦歡緋葷粺http://www.shnenglu.com/gaimor/archive/2010/08/11/123076.htmlccsdu2009ccsdu2009Wed, 11 Aug 2010 08:42:00 GMThttp://www.shnenglu.com/gaimor/archive/2010/08/11/123076.htmlhttp://www.shnenglu.com/gaimor/comments/123076.htmlhttp://www.shnenglu.com/gaimor/archive/2010/08/11/123076.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/123076.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/123076.html鍦╠evc++涓嬬紪璇戦渶瑕?涓簱涓涓猯ibboostsystem涓涓猯ibboostfilesystem
鍩烘湰鐨勭爺鍙戝涓?
#include <cstdlib>
#include 
<iostream>
#include 
<boost/filesystem.hpp>

using namespace std;
namespace fs = boost::filesystem;

int main(int argc, char *argv[])
{
    std::cout
<<"sizeof(intmax_t)is:"<<sizeof(boost::intmax_t)<<'\n';
    fs::path path(
"main.cpp",fs::native);
    
if(!fs::exists(path))
    {  
        
return -1;                     
    }
    
if(!fs::is_regular(path))
        
return -1;
    std::cout
<<"size is:"<<fs::file_size(path)<<"瀛楄妭"<<std::endl;    
    
    fs::path full_path(fs::initial_path
<fs::path>());
    full_path 
= fs::system_complete(fs::path("main.cpp"));  
    
//! 鑾峰彇緇欏畾鏂囦歡鍏ㄨ礬寰?nbsp; 
    cout<<"full path name is:"<<full_path.file_string()<<std::endl;
    
//! 媯嫻嬫槸涓嶆槸璺緞
    cout<<"is path:"<<fs::is_directory(full_path)<<std::endl;
  
    unsigned 
long file_count = 0;
    unsigned 
long dir_count = 0;
    unsigned 
long other_count = 0;
    unsigned 
long err_count = 0;    
    full_path 
= fs::system_complete(fs::path("C:\\WINDOWS"));
    
    
//! 鐩綍榪唬 
    fs::directory_iterator end_iter;
    
for(fs::directory_iterator dir_itr(full_path);dir_itr != end_iter;++dir_itr)
    {
       
try
       {
          
if(fs::is_directory(dir_itr->status()))
          {
              
++dir_count;
              std::cout
<<dir_itr->path().filename()<<"[directory]\n";
          }
          
else if(fs::is_regular_file(dir_itr->status()))
          {
              
++file_count;
              std::cout
<<dir_itr->path().filename()<<"\n";
              
//! 鍏ㄨ礬寰勫悕瀛?nbsp;
              std::cout<<dir_itr->path().native_file_string()<<std::endl;
          }
          
else
          {
              
++other_count;
              std::cout 
<< dir_itr->path().filename() <<"[other]\n";
          }
       }
       
catch(const std::exception & ex)
       {
          
++err_count;
          std::cout
<<dir_itr->path().filename()<<" "<<ex.what()<<std::endl;
       }
    }
    std::cout
<<"\n"<<file_count<<"files\n"<<dir_count<<" directories\n"<<other_count<<" others\n"<<err_count<<" errors\n"
    
    
//! 鐢熸垚鏂囦歡鐩綍
    fs::create_directories(fs::path("filesystem"));
    system(
"PAUSE");
    
return EXIT_SUCCESS;
}
//! ccsdu2004 
boost鏂囦歡緋葷粺榪樹笉閿?br>瑕佹槸鍐嶅姞鍏ュ鍘嬬緝鍖呮垨鑰呰祫婧愬寘鐨勬敮鎸佸氨鏇村ソ浜?



ccsdu2009 2010-08-11 16:42 鍙戣〃璇勮
]]>
boost涔?.瀛楃涓茬畻娉?/title><link>http://www.shnenglu.com/gaimor/archive/2010/08/10/122898.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Tue, 10 Aug 2010 02:11:00 GMT</pubDate><guid>http://www.shnenglu.com/gaimor/archive/2010/08/10/122898.html</guid><wfw:comment>http://www.shnenglu.com/gaimor/comments/122898.html</wfw:comment><comments>http://www.shnenglu.com/gaimor/archive/2010/08/10/122898.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/gaimor/comments/commentRss/122898.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/gaimor/services/trackbacks/122898.html</trackback:ping><description><![CDATA[鏈枃涓昏娑夊強boost涓璦lgorithm涔媠tring闂<br>鍩烘湰鐨勫瓧絎︿覆鍑芥暟綾誨瀷鏈?br>鏇挎崲<br>瑁佸壀<br>澶у皬鍐欐浛鎹?br>姝e垯琛ㄨ揪寮?br>鍒囧壊<br>鍒ゆ柇<br>鍜屾摝闄ゆ搷浣滅瓑絳?br> <div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #008000;">//</span><span style="color: #008000;">! boost涔?:瀛楃涓茬畻娉曠被 </span><span style="color: #008000;"><br></span><span style="color: #000000;">#include </span><span style="color: #000000;"><</span><span style="color: #0000ff;">string</span><span style="color: #000000;">></span><span style="color: #000000;"><br>#include </span><span style="color: #000000;"><</span><span style="color: #000000;">vector</span><span style="color: #000000;">></span><span style="color: #000000;"><br>#include </span><span style="color: #000000;"><</span><span style="color: #000000;">iostream</span><span style="color: #000000;">></span><span style="color: #000000;"><br>#include </span><span style="color: #000000;"><</span><span style="color: #000000;">iterator</span><span style="color: #000000;">></span><span style="color: #000000;"><br>#include </span><span style="color: #000000;"><</span><span style="color: #000000;">functional</span><span style="color: #000000;">></span><span style="color: #000000;"><br>#include </span><span style="color: #000000;"><</span><span style="color: #000000;">boost</span><span style="color: #000000;">/</span><span style="color: #000000;">algorithm</span><span style="color: #000000;">/</span><span style="color: #0000ff;">string</span><span style="color: #000000;">.hpp</span><span style="color: #000000;">></span><span style="color: #000000;"><br><br></span><span style="color: #0000ff;">using</span><span style="color: #000000;"> </span><span style="color: #0000ff;">namespace</span><span style="color: #000000;"> std;<br></span><span style="color: #0000ff;">using</span><span style="color: #000000;"> </span><span style="color: #0000ff;">namespace</span><span style="color: #000000;"> boost;<br><br></span><span style="color: #0000ff;">int</span><span style="color: #000000;"> main()<br>{  <br>    </span><span style="color: #008000;">//</span><span style="color: #008000;">! 瀛楃涓?nbsp;</span><span style="color: #008000;"><br></span><span style="color: #000000;">    </span><span style="color: #0000ff;">string</span><span style="color: #000000;"> str(</span><span style="color: #000000;">"</span><span style="color: #000000;"> abc-*-ABC-*-aBc </span><span style="color: #000000;">"</span><span style="color: #000000;">);<br>    <br>    </span><span style="color: #008000;">//</span><span style="color: #008000;">! 浠?鎴栬?鍒囧壊瀛楃涓?nbsp;</span><span style="color: #008000;"><br></span><span style="color: #000000;">    vector</span><span style="color: #000000;"><</span><span style="color: #000000;">std::</span><span style="color: #0000ff;">string</span><span style="color: #000000;">></span><span style="color: #000000;"> ret;<br>    split(ret,str,is_any_of(</span><span style="color: #000000;">"</span><span style="color: #000000;">-*</span><span style="color: #000000;">"</span><span style="color: #000000;">),token_compress_on);<br><br>    </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(unsigned </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> index</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;index</span><span style="color: #000000;"><</span><span style="color: #000000;">ret.size();index</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br>    {<br>        cout</span><span style="color: #000000;"><<</span><span style="color: #000000;">index</span><span style="color: #000000;"><<</span><span style="color: #000000;">"</span><span style="color: #000000;">:</span><span style="color: #000000;">"</span><span style="color: #000000;"><<</span><span style="color: #000000;">ret[index]</span><span style="color: #000000;"><<</span><span style="color: #000000;">endl;<br>    };<br>    <br>    </span><span style="color: #008000;">//</span><span style="color: #008000;">! 鍒囨崲涓哄皬鍐?/span><span style="color: #008000;"><br></span><span style="color: #000000;">    to_lower(str); <br>    cout</span><span style="color: #000000;"><<</span><span style="color: #000000;">"</span><span style="color: #000000;">*</span><span style="color: #000000;">"</span><span style="color: #000000;"><<</span><span style="color: #000000;">str</span><span style="color: #000000;"><<</span><span style="color: #000000;">"</span><span style="color: #000000;">*</span><span style="color: #000000;">"</span><span style="color: #000000;"><<</span><span style="color: #000000;">endl;<br>    </span><span style="color: #008000;">//</span><span style="color: #008000;">! 鍘繪帀宸﹁竟鐨勭┖鏍?/span><span style="color: #008000;"><br></span><span style="color: #000000;">    trim_left(str);<br>    cout</span><span style="color: #000000;"><<</span><span style="color: #000000;">"</span><span style="color: #000000;">*</span><span style="color: #000000;">"</span><span style="color: #000000;"><<</span><span style="color: #000000;">str</span><span style="color: #000000;"><<</span><span style="color: #000000;">"</span><span style="color: #000000;">*</span><span style="color: #000000;">"</span><span style="color: #000000;"><<</span><span style="color: #000000;">endl;<br>    </span><span style="color: #008000;">//</span><span style="color: #008000;">! 鍘繪帀鍙寵竟鐨勭┖鏍?/span><span style="color: #008000;"><br></span><span style="color: #000000;">    trim_right(str);<br>    cout</span><span style="color: #000000;"><<</span><span style="color: #000000;">"</span><span style="color: #000000;">*</span><span style="color: #000000;">"</span><span style="color: #000000;"><<</span><span style="color: #000000;">str</span><span style="color: #000000;"><<</span><span style="color: #000000;">"</span><span style="color: #000000;">*</span><span style="color: #000000;">"</span><span style="color: #000000;"><<</span><span style="color: #000000;">endl;<br>    <br>    </span><span style="color: #008000;">//</span><span style="color: #008000;">! 鏇挎崲</span><span style="color: #008000;"><br></span><span style="color: #000000;">    replace_all(str,</span><span style="color: #000000;">"</span><span style="color: #000000;">a</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">A</span><span style="color: #000000;">"</span><span style="color: #000000;">); <br>    cout</span><span style="color: #000000;"><<</span><span style="color: #000000;">str</span><span style="color: #000000;"><<</span><span style="color: #000000;">endl;<br>    </span><span style="color: #008000;">//</span><span style="color: #008000;">! 鎿﹂櫎 </span><span style="color: #008000;"><br></span><span style="color: #000000;">    cout</span><span style="color: #000000;"><<</span><span style="color: #000000;">erase_all_copy(str,</span><span style="color: #000000;">"</span><span style="color: #000000;">A</span><span style="color: #000000;">"</span><span style="color: #000000;">)</span><span style="color: #000000;"><<</span><span style="color: #000000;">endl;<br>    <br>    replace_nth(str,</span><span style="color: #000000;">"</span><span style="color: #000000;">c</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">2</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">ccsdu2004</span><span style="color: #000000;">"</span><span style="color: #000000;">); <br>    cout</span><span style="color: #000000;"><<</span><span style="color: #000000;">str</span><span style="color: #000000;"><<</span><span style="color: #000000;">endl;<br>    <br>    </span><span style="color: #008000;">//</span><span style="color: #008000;">! 鎿﹂櫎緇欏畾鑼冨洿</span><span style="color: #008000;"><br></span><span style="color: #000000;">    cout</span><span style="color: #000000;"><<</span><span style="color: #000000;">erase_range_copy(str,make_iterator_range(str.begin()</span><span style="color: #000000;">+</span><span style="color: #000000;">2</span><span style="color: #000000;">,str.begin()</span><span style="color: #000000;">+</span><span style="color: #000000;">5</span><span style="color: #000000;">))</span><span style="color: #000000;"><<</span><span style="color: #000000;">endl; <br>    <br>    cout</span><span style="color: #000000;"><<</span><span style="color: #000000;">"</span><span style="color: #000000;">is start with:A:</span><span style="color: #000000;">"</span><span style="color: #000000;"><<</span><span style="color: #000000;">starts_with(str,</span><span style="color: #0000ff;">string</span><span style="color: #000000;">(</span><span style="color: #000000;">"</span><span style="color: #000000;">A</span><span style="color: #000000;">"</span><span style="color: #000000;">))</span><span style="color: #000000;"><<</span><span style="color: #000000;">endl;<br>    cout</span><span style="color: #000000;"><<</span><span style="color: #000000;">"</span><span style="color: #000000;">is end with:C:</span><span style="color: #000000;">"</span><span style="color: #000000;"><<</span><span style="color: #000000;">ends_with(str,</span><span style="color: #0000ff;">string</span><span style="color: #000000;">(</span><span style="color: #000000;">"</span><span style="color: #000000;">C</span><span style="color: #000000;">"</span><span style="color: #000000;">))</span><span style="color: #000000;"><<</span><span style="color: #000000;">endl;<br>    cout</span><span style="color: #000000;"><<</span><span style="color: #000000;">"</span><span style="color: #000000;">is contain with:ccs:</span><span style="color: #000000;">"</span><span style="color: #000000;"><<</span><span style="color: #000000;">contains(str,</span><span style="color: #0000ff;">string</span><span style="color: #000000;">(</span><span style="color: #000000;">"</span><span style="color: #000000;">ccs</span><span style="color: #000000;">"</span><span style="color: #000000;">))</span><span style="color: #000000;"><<</span><span style="color: #000000;">endl;<br>    <br>    cout</span><span style="color: #000000;"><<</span><span style="color: #000000;">endl;<br>    system(</span><span style="color: #000000;">"</span><span style="color: #000000;">PAUSE</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br>    </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">;<br>}<br></span></div> <br><br><img src ="http://www.shnenglu.com/gaimor/aggbug/122898.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/gaimor/" target="_blank">ccsdu2009</a> 2010-08-10 10:11 <a href="http://www.shnenglu.com/gaimor/archive/2010/08/10/122898.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>boost涔?.minmaxhttp://www.shnenglu.com/gaimor/archive/2010/08/09/122769.htmlccsdu2009ccsdu2009Mon, 09 Aug 2010 05:31:00 GMThttp://www.shnenglu.com/gaimor/archive/2010/08/09/122769.htmlhttp://www.shnenglu.com/gaimor/comments/122769.htmlhttp://www.shnenglu.com/gaimor/archive/2010/08/09/122769.html#Feedback1http://www.shnenglu.com/gaimor/comments/commentRss/122769.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/122769.html
//! boost搴撳紩瀵?.minmax 
#include <list>
#include 
<algorithm>
#include 
<cstdlib>
#include 
<iostream>
#include 
<boost/algorithm/minmax.hpp>
#include 
<boost/algorithm/minmax_element.hpp>

using namespace std;
inline 
void Print(int i)
{
    std::cout
<<i<<std::endl;  
}

inline 
int Rand()
{
    
return rand()%10;       
}

int main()
{
    list
<int> l;
    typedef list
<int>::const_iterator iterator;
    
//! 浣跨敤緇欏畾娉涘嚱瀛愮敓鎴?2涓殢鏈烘暟騫舵帹鍏ラ摼琛?nbsp;
    generate_n(front_inserter(l),12,Rand);
    std::for_each(l.begin(),l.end(),Print);
    std::cout
<<"list size is:"<<l.size()<<std::endl;
    
//! 鑾峰彇緇欏畾搴忓垪鐨勫澶ф渶灝忓?榪斿洖涓簊td::pair<..,..> 
    pair<iterator,iterator> result = boost::minmax_element(l.begin(),l.end());
    cout
<<"the smallest element is:"<<*(result.first)<<endl;
    cout
<<"the largest element is:"<<*(result.second)<<endl;
    
//! 鑾峰彇絎竴涓渶灝忓厓绱?nbsp;
    iterator minitr = boost::first_min_element(l.begin(),l.end());
    cout
<<"first min element is:"<<*minitr<<endl;
    system(
"PAUSE");
    
return 1;
}

 
//! 鍚庤:浼間箮娌$湅鍒頒粈涔堝己澶х殑鍔熻兘
//!ccsdu2004



ccsdu2009 2010-08-09 13:31 鍙戣〃璇勮
]]>
国产亚洲精品美女久久久| avtt天堂网久久精品| 香蕉99久久国产综合精品宅男自| 久久精品国产精品青草app| 大美女久久久久久j久久| 久久久免费观成人影院| 久久天天躁夜夜躁狠狠| 国产一级持黄大片99久久| 欧美精品一区二区久久| 久久99精品久久久久久久不卡| 久久久久久久综合综合狠狠| 无码人妻久久一区二区三区免费丨 | 久久精品九九亚洲精品| 2020最新久久久视精品爱| av色综合久久天堂av色综合在| 久久精品成人国产午夜| 日本强好片久久久久久AAA| 久久人人爽人人爽人人片AV麻豆| 久久久久久狠狠丁香| 色欲综合久久躁天天躁| 人人狠狠综合久久亚洲88| 久久99精品免费一区二区| 久久久久99精品成人片试看| 亚洲国产小视频精品久久久三级| 日本福利片国产午夜久久| 久久久久免费看成人影片| 久久精品综合网| 久久久久综合国产欧美一区二区| 国产精品久久久久久| 99国产欧美精品久久久蜜芽| 日韩久久久久久中文人妻| 99蜜桃臀久久久欧美精品网站 | 久久精品一本到99热免费| 久久精品人妻中文系列| 久久人人爽人人爽人人av东京热 | 久久精品国产亚洲AV大全| 日韩精品久久久肉伦网站| 久久久久99精品成人片试看| 99久久er这里只有精品18| 久久久久久狠狠丁香| 国内精品久久久久久中文字幕|