??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久久久亚洲Av无码精品专口,亚洲综合熟女久久久30p,亚洲国产精品综合久久网络 http://www.shnenglu.com/ly4cn/p婆Q要比编E多一?..zh-cnTue, 06 May 2025 19:29:29 GMTTue, 06 May 2025 19:29:29 GMT60推荐一个稍微好用些的svn服务?/title><link>http://www.shnenglu.com/ly4cn/archive/2007/12/15/38570.html</link><dc:creator>沐枫</dc:creator><author>沐枫</author><pubDate>Sat, 15 Dec 2007 10:34:00 GMT</pubDate><guid>http://www.shnenglu.com/ly4cn/archive/2007/12/15/38570.html</guid><wfw:comment>http://www.shnenglu.com/ly4cn/comments/38570.html</wfw:comment><comments>http://www.shnenglu.com/ly4cn/archive/2007/12/15/38570.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/ly4cn/comments/commentRss/38570.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ly4cn/services/trackbacks/38570.html</trackback:ping><description><![CDATA[今天安装svn服务器。上官网下蝲Q发现windows下有一个稍微好用些的svn服务器?br> 下蝲地址Q?http://www.visualsvn.com/server/<br> <br> q个东西有几个特Ԍ(x)<br> 1. 安装和配|过E很方便Q最大优点之一Q?br> 2. 自带apache/ssl/mod_dav_svn/...{模块,既小巧,又简单,也安全一些?br> 3. 自带MSC理工具Q可以创建用戗用L(fng)Q还可以理多个源码库,以及(qing)配置各个路径的访问权限(最大优点之二)<br> <br> 通过上面下蝲地址Q可以看到截图。不q,截图的版本稍低点。目前的版本?.01。核心是Svn1.45Q与官方同步。其实它也是为官Ҏ(gu)供windowsUL版的|站之一?br> <br> 需要注意的是,q个|站提供的VisualSVN Server是免费的Q而客L(fng)VisualSVN是收费的。我们可以不用该客户端,客户端还是用TortoiseSVN/AnkhSVN之类的? VisualSVN客户端从介绍上看Q与AkuhSVN是差不多的,只不q功能上略有优点。定h$49?<img src ="http://www.shnenglu.com/ly4cn/aggbug/38570.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ly4cn/" target="_blank">沐枫</a> 2007-12-15 18:34 <a href="http://www.shnenglu.com/ly4cn/archive/2007/12/15/38570.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VC中的一个很奇怪的问题Q-关于C4244http://www.shnenglu.com/ly4cn/archive/2007/11/30/37550.html沐枫沐枫Fri, 30 Nov 2007 04:50:00 GMThttp://www.shnenglu.com/ly4cn/archive/2007/11/30/37550.htmlhttp://www.shnenglu.com/ly4cn/comments/37550.htmlhttp://www.shnenglu.com/ly4cn/archive/2007/11/30/37550.html#Feedback7http://www.shnenglu.com/ly4cn/comments/commentRss/37550.htmlhttp://www.shnenglu.com/ly4cn/services/trackbacks/37550.html     如下的代码:(x)
    short s1 = 0;
    
short s2 = 2;

    s1 
+= s2;
    在这两个~译器的 /w4 四警告打开的时候,冒Z下的警告来:(x)
warning C4244: “+=”: ?#8220;int”转换?#8220;short”Q可能丢失数?/span>
    Z消除q个警,只能?+= 拆成 = ?+Q如 s1 = s1 + s2?br>
    l于Q这个问题在VC2008消失了?img src ="http://www.shnenglu.com/ly4cn/aggbug/37550.html" width = "1" height = "1" />

沐枫 2007-11-30 12:50 发表评论
]]>
汉语~程++http://www.shnenglu.com/ly4cn/archive/2007/10/17/34476.html沐枫沐枫Wed, 17 Oct 2007 12:22:00 GMThttp://www.shnenglu.com/ly4cn/archive/2007/10/17/34476.htmlhttp://www.shnenglu.com/ly4cn/comments/34476.htmlhttp://www.shnenglu.com/ly4cn/archive/2007/10/17/34476.html#Feedback38http://www.shnenglu.com/ly4cn/comments/commentRss/34476.htmlhttp://www.shnenglu.com/ly4cn/services/trackbacks/34476.html     今天里头有人又把它d来了Q刚好无聊,也就发明了一个汉语编E语aQ集成到visual studio 2005的IDE中,名字叫汉语~程++Q欢q同h聊的朋友试用?br>
#include "常用头文?/span>"


整数 d?整数 参数数量, 字符指针 参数 是数l?
{
    整数 变量1 赋gؓ(f) 
3;
    如果(变量1 大于 
0)
    {
        打印(
"可以中文~程\n");
    }

    pȝ命o(h)(
"Pause");
    q回 
0;
}


    q行l果是Q?#8220;可以中文~程”
    语法呢,是C++一L(fng)Q那?#8220;常用头文?#8221;的内容如下:(x)
#define 整数 int
#define 如果 if
#define 大于 >
#define 打印 printf
#define pȝ命o(h) system
#define 赋gؓ(f) =
#define d?nbsp;_tmain
#define 字符指针 _TCHAR*
#define 是数l?nbsp;[]
#define q回

#include 
<tchar.h>
#include 
<iostream>

    唯一中不的是Q?include暂时无法汉化。于是劝里的h用这个写写情书,l果Q没人响?..
    不过Q?include 可以在项目属性中L它(C++高选项Q强制包含)Q或是指定编译命令参?/FI "常用头文? Q这样就可以L上面?#8220;#include "常用头文?”了?nbsp; 
-----
以上E序在VC++2005上编译ƈq行通过?br>
附群朋友的程序:(x)
高興?lt;>  19:54:59
q真有这么玩的啊
沐枫(Liny)()  19:55:02
各位朋友Q咱们提供一个头文gQ于是全中国人都可以用vc++2005来进行中文编E了?br>风在奔跑()  19:55:05
我从来没q么玩过.
沐枫(Liny)()  19:55:19
玩玩吧,挺好玩的?br>风在奔跑()  19:55:28
q脆把所有函数用中文define成一个中文编E库.
沐枫(Liny)()  19:55:30
不就是一?defing
沐枫(Liny)()  20:13:43
用这个写情书吧各位?br>西瓜()  20:13:57
x友不懂程序怎么?
Q_(d)Qᅢ()  20:13:58
q样的情?..球球不会(x)喜欢?
高興?lt;>  20:14:04
。。。情书里׃个弹出的对话?Ʋ知详情Q请看代?
西瓜()  20:14:17
球球又没出现

Q_(d)Qᅢ()  
20:19:00

#define 还 while
#define 那个?nbsp;int
#define ȝ来说 main
#define ?nbsp;cin
#define ?nbsp;cout
#define q?nbsp;>>
#define ?nbsp;<<
#define 拜拜?nbsp;return
#define L -=
#define {于 =
#define ?nbsp;100e4
#define 我说 (
#define 是吧 )
#define ?nbsp;a
#define 那么?nbsp;{
#define 得了 }
#define 呀 ;
#include 
<iostream>
using namespace std;

那个?nbsp;ȝ来说 我说 那个?nbsp;?nbsp;是吧
那么?nbsp;那个?nbsp;有钱 {于 ?nbsp;呀
还 我说 有钱 是吧    那么?br>那个?nbsp;多少 呀 ?nbsp;q?nbsp;多少 呀 ?nbsp;?nbsp;多少 呀 有钱 L 多少 呀
?nbsp;?nbsp;多少 呀 得了
拜拜?nbsp;?nbsp;呀 得了 

高興?/span><>  20:19:30
最有语义的中文~程诞生?nbsp;





沐枫 2007-10-17 20:22 发表评论
]]>
从赋值到初始?/title><link>http://www.shnenglu.com/ly4cn/archive/2007/09/27/33039.html</link><dc:creator>沐枫</dc:creator><author>沐枫</author><pubDate>Thu, 27 Sep 2007 09:39:00 GMT</pubDate><guid>http://www.shnenglu.com/ly4cn/archive/2007/09/27/33039.html</guid><wfw:comment>http://www.shnenglu.com/ly4cn/comments/33039.html</wfw:comment><comments>http://www.shnenglu.com/ly4cn/archive/2007/09/27/33039.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.shnenglu.com/ly4cn/comments/commentRss/33039.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ly4cn/services/trackbacks/33039.html</trackback:ping><description><![CDATA[<p>   C语言实很优雅,整个语言的设计简z一致。而在C++中,有一个让病的问题是变量初始化的不一致性?br>   C语言中的初始化,都是用花括号q行Q简单美观:(x)</p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> array[] </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">};<br></span><span style="COLOR: #0000ff">struct</span><span style="COLOR: #000000"> Point point </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">};<br></span><span style="COLOR: #0000ff">struct</span><span style="COLOR: #000000"> Point arrPoint[] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> <br>{<br>  {</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">},<br>  {</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">},<br>  {</span><span style="COLOR: #000000">6</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">7</span><span style="COLOR: #000000">}<br>};</span></div> <br>   C++自然也兼容了C语言的初始化机制。然而,C++的Class乃至STL都不支持。它们要用不同的方式来初始化Q?甚至Ҏ(gu)不能够直接初始化Q?只能使用q行时的赋倹{?br>   比如ClassQ? <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> Param<br>{<br></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br>  </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> Age;<br>  </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> Value;<br></span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">:<br>  </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> Level;<br>};<br><br>Param param </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: #008000">//</span><span style="COLOR: #008000"> ERROR</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">Param param </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">4</span><span style="COLOR: #000000">}; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">ERROR</span></div>    无法初始化。而如果不初始化的话,所有的成员而处于无政府状态,q显然很不让人放心。于是,C++提供了专门用于Class的初始化方式Q-构造函敎ͼ(x)<br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> Param<br>{<br></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br>  Param(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> x, </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> y)<br>    : x_(x), y_(y)<br>  {}<br>  Param()<br>    : x_(</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">), y_(</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">)<br>  {}<br></span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">:<br>  </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> x_, y_;<br>};<br><br>Param param(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">?/span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">Param param;</span></div>    有了构造函敎ͼ可以在构造函数的初始化列表中Ҏ(gu)员进行初始化。可是很明显Q这里头q是有一个陷阱,默认构造初始化和非默认构造初始化的调用方式是不一致的。默认构造函C能用括号来调用,否则~译器将?x)发疯?x)<br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">Param param();</span></div>    它会(x)把上面的语句看成是函数声明,而后面调用的时候就?x)出错,而错误信息可能会(x)让你抓狂一下。但是这样也q了,偏偏 new 可以接受有括号和没括号两U写法:(x)<br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">Param</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> p1 </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> Param;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>Param</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> p2 </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> Param();</span></div>    再来说说初始化列表。初始化列表Q事实上Q也只能支持单的标量cdQ诸如int,bool,指针之类的;复杂点的Q如数组、结构,不好意思,不支持-Q只能在构造函C中进行赋倹{还有一个很qL(fng)初学者的问题是,成员初始化的序仅依赖于成员定义的顺序,而不是初始化列表中的序?br><br>   再比如STL容器Q这下好象更惨,q构造函数都帮不上忙了,除了初始化一个空的容器,或是复制一下别的容器,我们只能做用默认构造函数进行初始化。我们拿数组和vecotr做个比较Q?br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> 数组</span><span style="COLOR: #008000"><br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> arr[]</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">};<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"> iarr;<br></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> 必须在某个函C赋初?/span><span style="COLOR: #008000"><br></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> init()<br>{<br>  </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">; i </span><span style="COLOR: #000000"><=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">; </span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">i) <br>    iarr.push_back(i);<br>}</span></div> <br>   再复杂一点的数据l构Q那单单赋值程序就要写上老长Q而且q不好看。还要记得调用。这对于仅仅是简单的讄一些初值的用途来_(d)太过于烦琐?br><br>   横向比较Q这ơ好象C++q不?x)太落伍Q只有C和动态语a提供了初始化Ҏ(gu),其它支持OO高语言好象都是学C++的。如Java, C#(注C#3.0开始提供初始化功能)...<br>   <br>   C++能不能做到简z一致的实始化呢Q?br>   Boost的assign库做了许多有益的工作。用assign库,臛_现在可以初始化了Q?<br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><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"> arr </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> list_of(</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">);   <br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>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><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>vector</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">tuple</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> v </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><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>map</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">,</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> next </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> map_list_of(</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">2</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">3</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">4</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">5</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">);<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> names </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> list_of( </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Mr. Foo</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> )( </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Mr. Bar</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)( </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Mrs. FooBar</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> ).to_adapter();</span></div>    如果是赋|也可以简略很多:(x)<br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><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><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>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">,repeat(</span><span style="COLOR: #000000">10</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><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> v = [1,2,3,4,4,4,4,4,4,4,4,4,4,5,6,7,8,9]</span></div>   不过Q也仅能如此了。assignl过许多努力Q也仅能支持容器的初始化Q而且q不够漂亮?br><br>   C++0x已确定提供与C一致的初始化功能?<a ><u><font color=#0000ff>Initialer lists</font></u></a> <a ><u><font color=#0000ff>Initializer Lists for Standard Containers</font></u></a> <a ><u><font color=#0000ff>Initializer lists WP wording</font></u></a> {草案就是ؓ(f)了这个目的服务的?br>   如果使用C++0xQ那么程序的初始化将变得清晰和一_(d)(x)<br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">complex</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> z </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">}; <br></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">?/span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">complex</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> z {</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">}; <br></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> 初始化中Q有{号和无{号都是允许的,下同?/span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">z </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">};<br><br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> a </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> {</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">}; <br><br></span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> vector</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">{</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">once</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">upon</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">, </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">time</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">}; <br><br>f( {</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Nicholas</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Annemarie</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">} ); </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> 参数是两个元素的列表</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> { </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Norah</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> }; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> q回只有一个元素的列表</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000"> <br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> e {};  </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> 初始化ؓ(f)0或NULL指针</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000"><br>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"> anim </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> <br>{ <br>  {</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">bear</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">}, <br>  {</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">cassovary</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">}, <br>  {</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">tiger</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">7</span><span style="COLOR: #000000">} <br>}; </span></div> <br>   q好象是C++Ơ了十多q的债吧?br>   <br> <img src ="http://www.shnenglu.com/ly4cn/aggbug/33039.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ly4cn/" target="_blank">沐枫</a> 2007-09-27 17:39 <a href="http://www.shnenglu.com/ly4cn/archive/2007/09/27/33039.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>从for到foreachhttp://www.shnenglu.com/ly4cn/archive/2007/09/26/32945.html沐枫沐枫Wed, 26 Sep 2007 11:51:00 GMThttp://www.shnenglu.com/ly4cn/archive/2007/09/26/32945.htmlhttp://www.shnenglu.com/ly4cn/comments/32945.htmlhttp://www.shnenglu.com/ly4cn/archive/2007/09/26/32945.html#Feedback11http://www.shnenglu.com/ly4cn/comments/commentRss/32945.htmlhttp://www.shnenglu.com/ly4cn/services/trackbacks/32945.html
int arr[N] = {/**/};
for(int i = 0; i < N; ++i)
  printf(
"arr[%d] = %d\n", i, arr[i]);

    然而,q种情况Q到了STLӞ有些变味了Q?br>
for(vector<MyClass>::const_iterator iter = m_vecData.begin(); iter != m_vecData.end(); ++iter)
{
    
if(!iter->IsBusy())
        iter
->DoSomeThing(param);
}
    q么长的一个forQ不再给ZU清晰的感觉了。或许因个程序比较短Q还没有太大的感觉,当回头去看自已的E序中,有不这L(fng)写法Ӟ我就觉得一阵心烦。改改?
for(size_t i = 0; i < m_vecData.size(); ++i)
{
    
if(!m_vecData[i].IsBusy())
        m_vecData[i].DoSomeThing(param);
}
    不错Q还是简单点好啊。但是因里D的是vector的例子。如果是list或是别的什么容器,p不通了?br>    其它的高U语aQ都提供了foreach或是for in语句Q写出来很清晰Q?br>
foreach(item in m_vecData)
{
    
if(!item.IsBusy())
        item.DoSomeThing(param);
}
    C++是不是也可以q么单?好象STL中也有一个for_eachQ试着改写一下:(x)
struct IfNotBusyThenDoSomeThing
{
   
IfNotBusyThenDoSomeThing(const Param& param)
        : param_(param)
    {}
    
void operator() (const MyClass& item)
    {
        
if(!item.IsBusy())
            item.DoSomeThing(param_);
    }
private:
    
const Param& param_;
};

for_each(m_vecData.begin(), m_vecData.end(),
IfNotBusyThenDoSomeThing(param));
    不错Qfor语句单了Q但是却多了IfNotBusyThenDoSomeThing的定义,q代码可是多了好几倍。要是每个@环都要来q么一下,我还不如直接写forQ要来得爽快一些。或许还有别的办法:(x)
vector<MyClass> notBusyClass;
remove_copy_if(m_vecData.begin(), m_vecData.end(), inserter(notBusyClass, notBusyClass.begin()), mem_fun_ref(
&MyClass::IsBusy));
for_each(notBusyClass.begin(), notBusyClass.end(), bind2nd(mem_fun_ref(
&MyClass::DoSomeThing), param));
    天哪Q这U写法好象更恐怖。而且Q还不是每种情况都能用的Q?br>    1. notBusyClass不能是vector<const MyClass&>Q因Z能徏立指向引用的指针。这p求MyClass是可拯的。但q是可拯的,有时候拷贝成本也是很高的?br>    2. MyClass::DoSomeThing的参C能是引用Q我们常定义参数为:(x)const Param&Q,因ؓ(f)不能定义引用的引用这U类型?br>    3. 一旦出现错误,q错误信息会(x)让h极其昏倒?br>
    看来单靠标准C++是不成的。Boost的lambda的库g很不错,用用Q?br>
    for_each(m_vecData.begin(), m_vecData.end(),
        if_then( !bind(
&MyClass::IsBusy, _1),
            bind(
&MyClass::DoSomeThing, _1, param)));
    不错Q好了一些,但是q是很不好看。有没有更好的?有,boost1.34新加入的BOOST_FOREACHQ?br>
BOOST_FOREACH(cosnt MyClass& item, m_vecData)
{
    
if(!item.IsBusy())
        item.DoSomeThing(param);
}
    Oh Yeah!

    好了Q问题来了,Z么C++不直接在语言中提供foreachq个功能呢?
    个h认ؓ(f)Q原因有几点Q?br>    1. C/C++除了数组外,没有内置的容器,因此for语句矣?br>    2. 当C++q化到STL的时候,C++标准委员?x)根本没I去考虑其它的?br>    而其它高U语a之所以内|了foreachQ就是因为它们一开始就提供了标准的容器库和q代/枚D接口Q因此提供foreach顺理成章了?br>
    现在QȝC++开始考虑Q由模板引入而造成的代码复杂性的问题Q这的确是Cpper的福韟뀂因此,一pd相关的提案被提交。牵涉到上面代码中的提案有Q?DecltypeQ?Lambda expressions and closures for C++Q?a >proposal for new for-loop。  
    其中Q最W合foreach要求的就是新的for循环。采用这个语句,上面的程序就可以q么写:(x)
for(const MyClass& item : m_vecData)
{
    
if(!item.IsBusy())
        item.DoSomeThing(param);
}

    不过Q考虑到Decltype&auto提案已经被采UI新的for-loop׃知道能不能再被采U뀂因Z用Decltype&auto后,E序可以q么写:(x)
for(auto iter = m_vecData.begin(), end = m_vecData.end(); iter != end; ++iter)
{
    if(!iter->IsBusy())
        iter->DoSomeThing(param);
}
    gq是复杂Ҏ(gu)吧?但是有了decltype&auto后,foreach功能可以用程序库或宏的Ş式被模拟QBOOST_FOREACH是q么做的。具体模拟的方式<<proposal for new for-loop>>提案写的很清楚了?br>    同时Q假如lambda提案要是能再被通过的话Q那q的要开心了Q?br>
for_each(
  m_vecData, 
  
<>(item) extern(param)
  {
    
if(!item.IsBusy())
        item.DoSomeThing(param);
  }
);
    Cool!

    不过QVC++2008倒是增加了foreach功能Q不q关键字不是foreachQ而是for eachQ这个让人有炚wP要用的时候最好用宏定义替换一下,免得可移植性上出现问题Q?br>


沐枫 2007-09-26 19:51 发表评论
]]>
VC2008 beta2 的几个新东西http://www.shnenglu.com/ly4cn/archive/2007/08/14/29954.html沐枫沐枫Mon, 13 Aug 2007 16:40:00 GMThttp://www.shnenglu.com/ly4cn/archive/2007/08/14/29954.htmlhttp://www.shnenglu.com/ly4cn/comments/29954.htmlhttp://www.shnenglu.com/ly4cn/archive/2007/08/14/29954.html#Feedback6http://www.shnenglu.com/ly4cn/comments/commentRss/29954.htmlhttp://www.shnenglu.com/ly4cn/services/trackbacks/29954.html1. 晕倒,实证后,没有增加tr1库(仅增加了tr1::hexfloat).
2. 对于模板?gt;>W号Q中间不再需要空g?br>3. 增加了for each(T& in A){}语法Q-q个不算是改q吧Q估计是Z?NET一起工作的产物?br>
q是今天下午初步扫一眼VC2008中Native C++后的感觉?br>同时Q标准库已不再支持Win95/98/me和NT4了?br>
至于C++/CLRQ一个重要的部䆾是STL/CLR?

沐枫 2007-08-14 00:40 发表评论
]]>
C++指针探讨 (? 函数对象http://www.shnenglu.com/ly4cn/archive/2007/07/21/28524.html沐枫沐枫Sat, 21 Jul 2007 13:36:00 GMThttp://www.shnenglu.com/ly4cn/archive/2007/07/21/28524.htmlhttp://www.shnenglu.com/ly4cn/comments/28524.htmlhttp://www.shnenglu.com/ly4cn/archive/2007/07/21/28524.html#Feedback4http://www.shnenglu.com/ly4cn/comments/commentRss/28524.htmlhttp://www.shnenglu.com/ly4cn/services/trackbacks/28524.html阅读全文

沐枫 2007-07-21 21:36 发表评论
]]>
boost 1.34 l于化了内嵌python的支?/title><link>http://www.shnenglu.com/ly4cn/archive/2007/05/23/24686.html</link><dc:creator>沐枫</dc:creator><author>沐枫</author><pubDate>Wed, 23 May 2007 04:58:00 GMT</pubDate><guid>http://www.shnenglu.com/ly4cn/archive/2007/05/23/24686.html</guid><wfw:comment>http://www.shnenglu.com/ly4cn/comments/24686.html</wfw:comment><comments>http://www.shnenglu.com/ly4cn/archive/2007/05/23/24686.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/ly4cn/comments/commentRss/24686.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ly4cn/services/trackbacks/24686.html</trackback:ping><description><![CDATA[boost 1.34 l于化了内嵌python的支持?br>q支持了python2.5?br>在中文windows下用vc8~译boost的过E中Q虽然仍有代码页字符警告Q但是可以正常编译成功,不再?.33.1那样造成正则表达式库不修Ҏ(gu)码不能够~译通过的问题了?br><br>下面的例子是从boost文中来的:(x)<br> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; 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;">iostream</span><span style="color: #000000;">></span><span style="color: #000000;"><br>#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;">boost</span><span style="color: #000000;">/</span><span style="color: #000000;">python.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: #0000ff;">ref</span><span style="color: #000000;">.hpp</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></span><span style="color: #0000ff;">using</span><span style="color: #000000;"> </span><span style="color: #0000ff;">namespace</span><span style="color: #000000;"> boost::python;<br><br></span><span style="color: #0000ff;">void</span><span style="color: #000000;"> greet()<br>{<br>    </span><span style="color: #0000ff;">object</span><span style="color: #000000;"> main </span><span style="color: #000000;">=</span><span style="color: #000000;"> import(</span><span style="color: #000000;">"</span><span style="color: #000000;">__main__</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br>    </span><span style="color: #0000ff;">object</span><span style="color: #000000;"> global(main.attr(</span><span style="color: #000000;">"</span><span style="color: #000000;">__dict__</span><span style="color: #000000;">"</span><span style="color: #000000;">));<br><br>    </span><span style="color: #008000;">//</span><span style="color: #008000;"> Define greet function in Python.</span><span style="color: #008000;"><br></span><span style="color: #000000;">    </span><span style="color: #0000ff;">object</span><span style="color: #000000;"> result </span><span style="color: #000000;">=</span><span style="color: #000000;"> exec(<br>        </span><span style="color: #000000;">"</span><span style="color: #000000;">def greet(a):               \n</span><span style="color: #000000;">"</span><span style="color: #000000;"><br>        </span><span style="color: #000000;">"</span><span style="color: #000000;">   return 'Hello %s from Python!' % a \n</span><span style="color: #000000;">"</span><span style="color: #000000;">,<br>        global, global);<br><br>    </span><span style="color: #0000ff;">object</span><span style="color: #000000;"> greet </span><span style="color: #000000;">=</span><span style="color: #000000;"> global[</span><span style="color: #000000;">"</span><span style="color: #000000;">greet</span><span style="color: #000000;">"</span><span style="color: #000000;">];<br><br>    list lst;<br>    lst.append(</span><span style="color: #000000;">1</span><span style="color: #000000;">);<br>    lst.append(</span><span style="color: #000000;">2</span><span style="color: #000000;">);<br><br>    </span><span style="color: #0000ff;">object</span><span style="color: #000000;"> r </span><span style="color: #000000;">=</span><span style="color: #000000;"> greet(lst);<br><br>    std::</span><span style="color: #0000ff;">string</span><span style="color: #000000;"> message </span><span style="color: #000000;">=</span><span style="color: #000000;"> extract</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;">(r);<br>    std::cout </span><span style="color: #000000;"><<</span><span style="color: #000000;"> message </span><span style="color: #000000;"><<</span><span style="color: #000000;"> std::endl;<br>}<br><br></span><span style="color: #0000ff;">int</span><span style="color: #000000;"> _tmain(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> argc, _TCHAR</span><span style="color: #000000;">*</span><span style="color: #000000;"> argv[])<br>{<br>    Py_Initialize();<br>    greet();<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>BTW:<br>  我用vc8~译了全部的boostQ然后,include加上lib目录Q内仅有lib和dll文gQ,合计2.68GB?br><br> <img src ="http://www.shnenglu.com/ly4cn/aggbug/24686.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ly4cn/" target="_blank">沐枫</a> 2007-05-23 12:58 <a href="http://www.shnenglu.com/ly4cn/archive/2007/05/23/24686.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Boost 1.34.0 ?.12发布http://www.shnenglu.com/ly4cn/archive/2007/05/13/24069.html沐枫沐枫Sun, 13 May 2007 14:24:00 GMThttp://www.shnenglu.com/ly4cn/archive/2007/05/13/24069.htmlhttp://www.shnenglu.com/ly4cn/comments/24069.htmlhttp://www.shnenglu.com/ly4cn/archive/2007/05/13/24069.html#Feedback0http://www.shnenglu.com/ly4cn/comments/commentRss/24069.htmlhttp://www.shnenglu.com/ly4cn/services/trackbacks/24069.html

昨天Qboostl于发布?.34版本。该版本新增加了几个内容Q?br>1. BOOST_FOREACH ?br>  一直对于C++的iterator枚D元素造成的bad smell感到无奈Q同Ӟ许多语言都增加了foreach机制。终于,boost增加了这个枚丑ַ兗从此,C++的枚举不再难看。如Q?br>

#define foreach BOOST_FOREACH
short array_short[] = { 123 };
foreachshort & i, array_short )
{
    
++i;
}

  BOOST_FOREACH宏大大改良了代码可读性?br>

  上述E序执行后,array_short的内容ؓ(f)Q{2,3,4}?nbsp;

2. 状态图
  随着工作?WorkFlow)的流行,Boost也加入了状态机。这对于E序l构的优化,是一个好的补充?br>3. Tr1
  随着C++0x的进展,Tr1已经被通过。下一ơBoost可能增加Tr2了?br>4. Typeof ?br>  C++0x中的auto的替代品。时常关心C++0xq展的h׃(x)知道auto的作用,现在l于可以提前使用了。只是没有auto漂亮Q目前也仅能如此了,毕竟它现在能工作?br>5. Xpressive?br>  属于C++的正则表辑ּ库。以前都是用字串来保存正则表辑ּQ现在终于可以用C++的表辑ּ来写正则了?br>

?http://www.boost.org



沐枫 2007-05-13 22:24 发表评论
]]>
Lua脚本入门http://www.shnenglu.com/ly4cn/archive/2006/08/08/10983.html沐枫沐枫Tue, 08 Aug 2006 05:09:00 GMThttp://www.shnenglu.com/ly4cn/archive/2006/08/08/10983.htmlhttp://www.shnenglu.com/ly4cn/comments/10983.htmlhttp://www.shnenglu.com/ly4cn/archive/2006/08/08/10983.html#Feedback0http://www.shnenglu.com/ly4cn/comments/commentRss/10983.htmlhttp://www.shnenglu.com/ly4cn/services/trackbacks/10983.html摘要:  在这里,我想向大家介l如何进行LuaE序设计?br />
全文Q?a id="_36e1fb1c2c34_HomePageDays_DaysList_ctl01_DayItem_DayList_ctl00_TitleUrl" >Lua脚本入门

沐枫 2006-08-08 13:09 发表评论
]]>
C++用bitsetq行2q制输入输出 http://www.shnenglu.com/ly4cn/archive/2006/06/29/9142.html沐枫沐枫Thu, 29 Jun 2006 02:14:00 GMThttp://www.shnenglu.com/ly4cn/archive/2006/06/29/9142.htmlhttp://www.shnenglu.com/ly4cn/comments/9142.htmlhttp://www.shnenglu.com/ly4cn/archive/2006/06/29/9142.html#Feedback1http://www.shnenglu.com/ly4cn/comments/commentRss/9142.htmlhttp://www.shnenglu.com/ly4cn/services/trackbacks/9142.html 用bitsetq行2q制输入输出

沐枫 2006-06-29 10:14 发表评论
]]>
汇编语言的Hello Worldhttp://www.shnenglu.com/ly4cn/archive/2006/04/06/5077.html沐枫沐枫Thu, 06 Apr 2006 04:05:00 GMThttp://www.shnenglu.com/ly4cn/archive/2006/04/06/5077.htmlhttp://www.shnenglu.com/ly4cn/comments/5077.htmlhttp://www.shnenglu.com/ly4cn/archive/2006/04/06/5077.html#Feedback1http://www.shnenglu.com/ly4cn/comments/commentRss/5077.htmlhttp://www.shnenglu.com/ly4cn/services/trackbacks/5077.html全文见:(x)汇编语言的Hello World

沐枫 2006-04-06 12:05 发表评论
]]>
C++指针探讨 (? 成员函数指针http://www.shnenglu.com/ly4cn/archive/2006/03/13/4092.html沐枫沐枫Mon, 13 Mar 2006 08:44:00 GMThttp://www.shnenglu.com/ly4cn/archive/2006/03/13/4092.htmlhttp://www.shnenglu.com/ly4cn/comments/4092.htmlhttp://www.shnenglu.com/ly4cn/archive/2006/03/13/4092.html#Feedback0http://www.shnenglu.com/ly4cn/comments/commentRss/4092.htmlhttp://www.shnenglu.com/ly4cn/services/trackbacks/4092.html  C语言的指针相当的灉|方便Q但也相当容易出错。许多C语言初学者,甚至C语言老鸟都很Ҏ(gu)栽倒在C语言的指针下。但不可否认的是Q指针在C语言中的位置极其重要Q也许可以偏Ȁ一点的来说Q没有指针的CE序不是真正的CE序?BR>  然而C++的指针却常常l我一U束手束脚的感觉。C++比C语言更加强类型,cd安全Q强调编译时(g)查。因此,对于C语言中最Ҏ(gu)错用的指针,更是不能放过QC++的指针被分成数据指针Q数据成员指针,函数指针Q成员函数指针,而且不能随便怺转换。而且q些指针的声明格式都不一P(x)

数据指针 T *
成员数据指针 T::*
函数指针 R (*)(...)
成员函数指针 R (T::*)(...)

  管C++中仍然有万能指针void*Q但它却属于被批斗的对象Q而且再也不能“万能”了。它不能转换成成员指针?/P>

  q样一来,C++的指针就变得很尴:(x)我们需要一U指针能够指向同一cd的数据,不管q个数据是普通数据,q是成员数据Q我们更需要一U指针能够指向同一cd的函敎ͼ不管q个函数是静态函敎ͼq是成员函数。但是没有,臛_从现在的C++标准中,q没有看到?BR>
全文??A id=viewpost1_TitleUrl >C++指针探讨 (? 成员函数指针 ?/P>

沐枫 2006-03-13 16:44 发表评论
]]>
C++指针探讨 (? 函数指针http://www.shnenglu.com/ly4cn/archive/2005/12/17/1843.html沐枫沐枫Sat, 17 Dec 2005 03:53:00 GMThttp://www.shnenglu.com/ly4cn/archive/2005/12/17/1843.htmlhttp://www.shnenglu.com/ly4cn/comments/1843.htmlhttp://www.shnenglu.com/ly4cn/archive/2005/12/17/1843.html#Feedback0http://www.shnenglu.com/ly4cn/comments/commentRss/1843.htmlhttp://www.shnenglu.com/ly4cn/services/trackbacks/1843.html在C/C++中,数据指针是最直接Q也最常用的,因此Q理解v来也比较Ҏ(gu)。而函数指针,作ؓ(f)q行时动态调用(比如回调函数 CallBack FunctionQ是一U常见的Q而且是很好用的手Dc(din)?

注:(x)q一部䆾没什么h(hun)|U是Z引出下一节的内容?BR>
L(fng)此处阅读全文Q?A id=_33cd042ed710233_HomePageDays_DaysList__ctl0_DayItem_DayList__ctl0_TitleUrl >C++指针探讨 (? 函数指针

沐枫 2005-12-17 11:53 发表评论
]]>
C++指针探讨 Q一Q数据指?/title><link>http://www.shnenglu.com/ly4cn/archive/2005/11/30/1434.html</link><dc:creator>沐枫</dc:creator><author>沐枫</author><pubDate>Wed, 30 Nov 2005 03:12:00 GMT</pubDate><guid>http://www.shnenglu.com/ly4cn/archive/2005/11/30/1434.html</guid><wfw:comment>http://www.shnenglu.com/ly4cn/comments/1434.html</wfw:comment><comments>http://www.shnenglu.com/ly4cn/archive/2005/11/30/1434.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/ly4cn/comments/commentRss/1434.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ly4cn/services/trackbacks/1434.html</trackback:ping><description><![CDATA[指针Q在C/C++语言中一直是很受宠的Q几乎找不到一个不使用指针的C/C++应用。用于存储数据和E序的地址Q这是指针的基本功能。用于指向整型数Q用整数指针(int*)Q指向QҎ(gu)用QҎ(gu)指针(float*)Q指向结构,用对应的l构指针(struct xxx *)Q指向Q意地址Q用无类型指?void*)?<BR>本文先探讨C++中用于存储各U类型数据的指针?<BR><BR>——全文请见:(x)<A id=_1edf50c25fd11b89_HomePageDays_DaysList__ctl0_DayItem_DayList__ctl0_TitleUrl ><FONT color=#000080>C++指针探讨 Q一Q数据指?/FONT></A><BR><img src ="http://www.shnenglu.com/ly4cn/aggbug/1434.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ly4cn/" target="_blank">沐枫</a> 2005-11-30 11:12 <a href="http://www.shnenglu.com/ly4cn/archive/2005/11/30/1434.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>лǵվܻԴȤ</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.whcxjj.cn" target="_blank">Ů㽶þ**ëƬƷ</a>| <a href="http://www.znaw.cn" target="_blank">ƷþþӰ</a>| <a href="http://www.mytsy.cn" target="_blank">ۺϾþþƷ</a>| <a href="http://www.gx177.cn" target="_blank">þԭƷ</a>| <a href="http://www.beidoukemao.cn" target="_blank">޹þþþƷ</a>| <a href="http://www.aoshidun.com.cn" target="_blank">ŷԴսþþþþ </a>| <a href="http://www.dnf530.cn" target="_blank">˳վ999þþۺ </a>| <a href="http://www.ytmsw.cn" target="_blank">ɫ99þþþø߳ۺӰԺ</a>| <a href="http://www.0470gq.cn" target="_blank">þ99Ʒ鶹ѿ</a>| <a href="http://www.jsjdzz.cn" target="_blank">þĻ</a>| <a href="http://www.jiaotongpai.cn" target="_blank">þۺɫݺ</a>| <a href="http://www.tjywmc.cn" target="_blank">Ʒþþþþ</a>| <a href="http://www.axrf.cn" target="_blank">ŷþþXXX</a>| <a href="http://www.himalayasmuseum.com.cn" target="_blank">Ʒ99þѹۿ</a>| <a href="http://www.lntyzx.com.cn" target="_blank">99þѹۺϾƷ</a>| <a href="http://www.ovnz.cn" target="_blank">þòþüӰԺwwwձ</a>| <a href="http://www.lxyizhixiu.cn" target="_blank">þó18վ</a>| <a href="http://www.iaro.cn" target="_blank">þþþþAVר</a>| <a href="http://www.bethesdagroup.cn" target="_blank">ŷ777Ʒþþþ</a>| <a href="http://www.minghuzisha.cn" target="_blank">ȾþùþƷ </a>| <a href="http://www.6ird.cn" target="_blank">ɫ8ŷ˾þۺϵ</a>| <a href="http://www.originblog.cn" target="_blank">ƷۺϾþþþþ97</a>| <a href="http://www.dicy888.cn" target="_blank">99þþƷѿ</a>| <a href="http://www.gzfbn.cn" target="_blank">ݺۺϾþAVһ</a>| <a href="http://www.xibeiguangdian.cn" target="_blank">޹Ʒþ98</a>| <a href="http://www.wyhwan.cn" target="_blank">þóѲ</a>| <a href="http://www.lvzhuba.cn" target="_blank">Ʒþ777</a>| <a href="http://www.122v.cn" target="_blank">þ91Ʒ91þ鶹</a>| <a href="http://www.wanhejingshui.cn" target="_blank">޾ƷŮþ777777</a>| <a href="http://www.dongfangmoney.cn" target="_blank">ҹƵþþþһ</a>| <a href="http://www.szsantong.com.cn" target="_blank">ھƷþþþþþɬ</a>| <a href="http://www.cgx.org.cn" target="_blank">þ޾ƷĻ</a>| <a href="http://www.damangdao.cn" target="_blank">91þ㽶Ů߿</a>| <a href="http://www.hanxuefs.com.cn" target="_blank">ŷþþþþ</a>| <a href="http://www.888happy.cn" target="_blank">þAVһ</a>| <a href="http://www.xorfbrt.cn" target="_blank">ŷպƷþþþ</a>| <a href="http://www.wbyyd.cn" target="_blank">þۺϾþԾ99ëƬ</a>| <a href="http://www.banzheng128.cn" target="_blank">ƷѾþþþùһ</a>| <a href="http://www.kuaixiansou.cn" target="_blank">Ʒѿþþ㽶</a>| <a href="http://www.sdmtsk.cn" target="_blank">þþþӰԺС </a>| <a href="http://www.yunshanhong.cn" target="_blank">ҹƷþþþþþ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>