﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-The Coder</title><link>http://www.cppblog.com/bch515/</link><description>I am a humble coder.</description><language>zh-cn</language><lastBuildDate>Sun, 05 Apr 2026 20:45:04 GMT</lastBuildDate><pubDate>Sun, 05 Apr 2026 20:45:04 GMT</pubDate><ttl>60</ttl><item><title>OpenGL的视图变换</title><link>http://www.cppblog.com/bch515/archive/2006/08/11/11142.html</link><dc:creator>TH</dc:creator><author>TH</author><pubDate>Fri, 11 Aug 2006 14:27:00 GMT</pubDate><guid>http://www.cppblog.com/bch515/archive/2006/08/11/11142.html</guid><wfw:comment>http://www.cppblog.com/bch515/comments/11142.html</wfw:comment><comments>http://www.cppblog.com/bch515/archive/2006/08/11/11142.html#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://www.cppblog.com/bch515/comments/commentRss/11142.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bch515/services/trackbacks/11142.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: OpenGL				中场景进行变换，要经历一些过程：视图变换										à								模型变换										à								投影变换，然后到了窗口坐标。这几个变换开始的时候把我搞很混，这几天整理一下。														       								一般书上把这几个变换用照相机类比，其实每个变换都是产生着一个...&nbsp;&nbsp;<a href='http://www.cppblog.com/bch515/archive/2006/08/11/11142.html'>阅读全文</a><img src ="http://www.cppblog.com/bch515/aggbug/11142.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bch515/" target="_blank">TH</a> 2006-08-11 22:27 <a href="http://www.cppblog.com/bch515/archive/2006/08/11/11142.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>左值、右值</title><link>http://www.cppblog.com/bch515/archive/2006/06/02/8078.html</link><dc:creator>TH</dc:creator><author>TH</author><pubDate>Fri, 02 Jun 2006 04:03:00 GMT</pubDate><guid>http://www.cppblog.com/bch515/archive/2006/06/02/8078.html</guid><wfw:comment>http://www.cppblog.com/bch515/comments/8078.html</wfw:comment><comments>http://www.cppblog.com/bch515/archive/2006/06/02/8078.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bch515/comments/commentRss/8078.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bch515/services/trackbacks/8078.html</trackback:ping><description><![CDATA[
		<p>下面这段引文可对左值、右值加深理解。<br /><br />参考文献：《ANSI/ISO C++ Professional Programmer's Handbook》</p>
		<p>lvalues and rvalues<br />An object is a contiguous region of storage. An lvalue is an expression that refers to such an object. The original<br />definition of lvalue referred to an object that can appear on the left-hand side of an assignment. However, const<br />objects are lvalues that cannot be used in the left-hand side of an assignment. Similarly, an expression that can appear<br />in the right-hand side of an expression (but not in the left-hand side of an expression) is an rvalue. For example<br /></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: #000000">#include </span>
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #0000ff">string</span>
				<span style="COLOR: #000000">&gt;</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"> std;<br /></span>
				<span style="COLOR: #0000ff">int</span>
				<span style="COLOR: #000000">&amp;</span>
				<span style="COLOR: #000000"> f();<br /></span>
				<span style="COLOR: #0000ff">void</span>
				<span style="COLOR: #000000"> func()<br />{<br />    </span>
				<span style="COLOR: #0000ff">int</span>
				<span style="COLOR: #000000"> n;<br />    </span>
				<span style="COLOR: #0000ff">char</span>
				<span style="COLOR: #000000"> buf[</span>
				<span style="COLOR: #000000">3</span>
				<span style="COLOR: #000000">];<br />    n </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">5</span>
				<span style="COLOR: #000000">; </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000"> n is an lvalue; 5 is an rvalue</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">    buf[</span>
				<span style="COLOR: #000000">0</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">a</span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">; </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000"> buf[0] is an lvalue, 'a' is an rvalue</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">    </span>
				<span style="COLOR: #0000ff">string</span>
				<span style="COLOR: #000000"> s1 </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">, s2 </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">b</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">, s3 </span>
				<span style="COLOR: #000000">=</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: #008000">//</span>
				<span style="COLOR: #008000"> "a", "b", "c" are rvalues</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">    s1 </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000"> lvalue</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">    s2 </span>
				<span style="COLOR: #000000">+</span>
				<span style="COLOR: #000000">s3; </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">s2 and s3 are lvalues that are  implicitly converted to rvalues</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">    s1 </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">lvalue</span>
				<span style="COLOR: #008000">
						<br />
				</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">z</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">); </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">temporaries are rvalues</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">    </span>
				<span style="COLOR: #0000ff">int</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">*</span>
				<span style="COLOR: #000000"> p </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">new</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">int</span>
				<span style="COLOR: #000000">; </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">p is an lvalue; 'new int' is an rvalue</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">    f() </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000">; </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">a function call that returns a reference is an lvalue</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">     s1.size(); </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">otherwise, a function call is an rvalue expression</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">}<br /></span>
		</div>
		<br />An lvalue can appear in a context that requires an rvalue; in this case, the lvalue is implicitly converted to an rvalue.<br />An rvalue cannot be converted to an lvalue. Therefore, it is possible to use every lvalue expression in the example as<br />an rvalue, but not vice versa.<br /><img src ="http://www.cppblog.com/bch515/aggbug/8078.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bch515/" target="_blank">TH</a> 2006-06-02 12:03 <a href="http://www.cppblog.com/bch515/archive/2006/06/02/8078.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>博客定位。</title><link>http://www.cppblog.com/bch515/archive/2006/05/30/7859.html</link><dc:creator>TH</dc:creator><author>TH</author><pubDate>Tue, 30 May 2006 03:36:00 GMT</pubDate><guid>http://www.cppblog.com/bch515/archive/2006/05/30/7859.html</guid><wfw:comment>http://www.cppblog.com/bch515/comments/7859.html</wfw:comment><comments>http://www.cppblog.com/bch515/archive/2006/05/30/7859.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bch515/comments/commentRss/7859.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bch515/services/trackbacks/7859.html</trackback:ping><description><![CDATA[现在有个困惑，不知道博客怎么写。既然是个专业性的博客，就不敢再这里乱写。<br />对博客定位的问题，我也思考数日。觉得博客可以有两个分类。<br />1、. 作为初学者学习的成长历程。从hello world开始。当然，至于最后能将这个历程走到哪里，却不得而知了。更甚者，不知是按部就班，一步一步学，还是心血来潮，想到哪里学哪里。<br />2 、 作为一个专题性的主题讨论。提出一个问题，解决它，再谈论，改进。这样的一个好处就是能对问题有清晰的认识和解决问题能力的也会提高。主题来来源可以是别人的博客上的subject，平时遇到的问题，解决问题时候出来的新问题等等。<br /><br />写博克的形式，我想大致可以以上面两种。<br />更关心的问题是，我们在写博客的过程中能得到什么？即既得利益所得。这也同样是能否继续写下去的一个驱动力。<br />可以得到的，我想可以有：１、能力积累。分析、解决问题的能力。<br />　　　　　　　                    ２、技术积累。技术知识的扩张。<br />　　　　　　                        ３、代码积累。算法、编程技巧的积淀。同时可以为创新作积累。　<br />　　　　　　　　　　　　４、技术会友。有朋自远方来．．．　　<br /><br /><br /><br />这是我对即将开张的博客的一些想法，请多多指教。<br /><br /><br />/---------------------------------------------------------------------------------<br />时代有时代的主题，文章也有自己的主旨。偏离了方向，最终会被抛弃。　　<br />-----------------------------------------------------------------------------------/<br /><br /><img src ="http://www.cppblog.com/bch515/aggbug/7859.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bch515/" target="_blank">TH</a> 2006-05-30 11:36 <a href="http://www.cppblog.com/bch515/archive/2006/05/30/7859.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>新人报到</title><link>http://www.cppblog.com/bch515/archive/2006/05/28/7769.html</link><dc:creator>TH</dc:creator><author>TH</author><pubDate>Sun, 28 May 2006 06:16:00 GMT</pubDate><guid>http://www.cppblog.com/bch515/archive/2006/05/28/7769.html</guid><wfw:comment>http://www.cppblog.com/bch515/comments/7769.html</wfw:comment><comments>http://www.cppblog.com/bch515/archive/2006/05/28/7769.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/bch515/comments/commentRss/7769.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bch515/services/trackbacks/7769.html</trackback:ping><description><![CDATA[大家好:<br />        我是TH。来自杭州，致力于C++和图形学等方面。请多多指教。<img src ="http://www.cppblog.com/bch515/aggbug/7769.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bch515/" target="_blank">TH</a> 2006-05-28 14:16 <a href="http://www.cppblog.com/bch515/archive/2006/05/28/7769.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>