锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲美女黄色,亚洲欧美日韩一区二区三区在线观看 ,国产精品剧情在线亚洲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 鍙戣〃璇勮
]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            欧美专区中文字幕| 裸体一区二区三区| 久久久久女教师免费一区| 国产亚洲欧美日韩日本| 久久精品日产第一区二区三区| 亚洲福利小视频| 欧美久久久久久蜜桃| 亚洲精品国偷自产在线99热| 亚洲综合视频在线| 国产女人18毛片水18精品| 久久精品视频在线播放| 亚洲国产精品美女| 午夜精品久久久久久久99水蜜桃 | 国产欧美精品日韩| 欧美一区在线视频| 亚洲国产日韩在线| 欧美一区二区三区免费观看| 一区二区三区在线视频免费观看| 欧美高清在线一区| 亚洲一区二区av电影| 久久久久久尹人网香蕉| 一道本一区二区| 国产综合视频| 国产视频一区免费看| 久久久99国产精品免费| 亚洲国产精品久久久久秋霞影院 | 亚洲一区二区少妇| 麻豆国产精品va在线观看不卡| 99精品免费| 国产综合色产| 久久综合影音| 一本色道久久综合狠狠躁的推荐| 国产视频一区三区| 欧美色播在线播放| 久久久久久久国产| 夜夜躁日日躁狠狠久久88av| 欧美1区视频| 欧美一级久久| av成人免费观看| 在线精品一区| 国产欧美一区二区精品性| 欧美精品一区二区三区一线天视频| 欧美一区二区女人| 亚洲欧洲综合另类在线| 国产亚洲成人一区| 欧美视频三区在线播放| 欧美成人精品三级在线观看| 香蕉久久一区二区不卡无毒影院| 亚洲人成在线播放网站岛国| 美女被久久久| 欧美中在线观看| 亚洲影视中文字幕| 一本一本久久| 亚洲精品乱码久久久久久日本蜜臀| 韩日成人在线| 国产日韩欧美一区| 国产精品毛片a∨一区二区三区| 欧美国产日韩xxxxx| 美女黄毛**国产精品啪啪| 久久成人资源| 久久精品国产精品亚洲精品| 欧美一区二区三区啪啪| 亚洲综合精品| 亚洲欧美资源在线| 亚洲免费伊人电影在线观看av| 一区二区三区回区在观看免费视频| 91久久午夜| 亚洲激情在线观看| 亚洲日本中文字幕区| 亚洲精品激情| 亚洲作爱视频| 亚洲午夜精品17c| 亚洲视频1区| 亚洲影视综合| 欧美在线免费看| 久久精品国产精品| 巨胸喷奶水www久久久免费动漫| 久久天天狠狠| 欧美电影免费网站| 欧美日韩免费区域视频在线观看| 欧美日韩亚洲国产一区| 欧美日韩综合视频| 国产精品乱码人人做人人爱| 国产美女精品免费电影| 国产视频一区二区三区在线观看| 国内成+人亚洲+欧美+综合在线| 韩国成人精品a∨在线观看| 在线观看国产成人av片| 亚洲精品你懂的| 中日韩美女免费视频网站在线观看| 亚洲影院色无极综合| 欧美在线观看日本一区| 浪潮色综合久久天堂| 亚洲国产欧美不卡在线观看| 日韩一级大片| 性欧美精品高清| 欧美成人免费网| 国产精品久久久久9999| 韩国成人精品a∨在线观看| 亚洲激情av在线| 亚洲在线播放电影| 久久综合九色99| 亚洲国产一区在线| 亚洲——在线| 免费成人黄色| 国产精品欧美一区二区三区奶水 | 久久国产黑丝| 欧美国产日本高清在线| 国产精品丝袜xxxxxxx| 亚洲国产mv| 午夜激情综合网| 欧美电影免费观看高清完整版| 日韩视频免费观看| 久久久国产91| 欧美视频中文在线看| 激情婷婷久久| 午夜精品一区二区三区四区| 蜜臀久久99精品久久久久久9| 亚洲美女淫视频| 久久米奇亚洲| 国产精品日韩欧美| 亚洲精选视频免费看| 久久国产综合精品| 亚洲免费高清视频| 久久野战av| 国产亚洲视频在线| 亚洲新中文字幕| 亚洲国产精品一区二区久| 欧美在线999| 国产精品国产a级| 亚洲精选成人| 免费在线成人| 欧美在线播放| 国产精品入口日韩视频大尺度| 最新国产拍偷乱拍精品| 久久影院午夜论| 亚洲免费在线视频一区 二区| 欧美伦理影院| 亚洲精品三级| 欧美国产另类| 久久久久免费视频| 国产亚洲网站| 久久国产黑丝| 亚洲欧美日韩天堂| 国产精品jizz在线观看美国 | 亚洲国产精品电影| 欧美一二三区精品| 日韩亚洲在线观看| 欧美日韩成人激情| 亚洲精品乱码视频| 欧美成人在线影院| 老司机成人网| 激情五月综合色婷婷一区二区| 久久国产欧美日韩精品| 亚洲一区不卡| 国产精品女人网站| 午夜精品三级视频福利| 亚洲视频观看| 国产精品v欧美精品∨日韩| 99亚洲视频| 99国产精品久久久| 欧美日韩综合久久| 亚洲自拍偷拍色片视频| 一区二区三区四区精品| 国产精品麻豆欧美日韩ww| 亚洲男人第一网站| 亚洲综合不卡| 国产亚洲激情| 麻豆国产精品一区二区三区| 久久字幕精品一区| 最新高清无码专区| 亚洲精品影院在线观看| 欧美日韩在线第一页| 香蕉久久国产| 欧美自拍偷拍午夜视频| 在线欧美日韩精品| 亚洲黄色av| 欧美视频四区| 久久精品九九| 欧美**字幕| 亚洲一级电影| 欧美亚洲免费在线| 亚洲第一综合天堂另类专| 亚洲国产影院| 国产精品日韩在线一区| 久久手机精品视频| 欧美风情在线观看| 亚洲欧美日韩一区在线观看| 午夜性色一区二区三区免费视频| 激情小说另类小说亚洲欧美| 亚洲国产经典视频| 国产精品久久久久久久电影| 久久乐国产精品| 欧美激情精品| 久久国产精彩视频| 欧美成黄导航| 午夜亚洲性色视频| 麻豆成人在线| 午夜一区二区三区不卡视频| 久久亚洲春色中文字幕|