inline  向 compiler 保證 , 你不管看到幾次 這個 function , 它的內容都一樣 !!

還有建議 compiler 將內容 "插入" 呼叫它的 function , compiler 可以選擇接受 or not !!

hedgezzz 發表在 痞客邦 留言(0) 人氣()

http://definedbehavior.blogspot.tw/2011/08/value-semantics-copy-elision.html

 

hedgezzz 發表在 痞客邦 留言(0) 人氣()

這個例子只能用 c++11 , c++0x compiler 會失敗 !!!

hedgezzz 發表在 痞客邦 留言(0) 人氣()

http://definedbehavior.blogspot.tw/2011/08/value-semantics-copy-elision.html

 

hedgezzz 發表在 痞客邦 留言(0) 人氣()

class Mars
{

hedgezzz 發表在 痞客邦 留言(0) 人氣()

從這裡來的文章 :

http://my.safaribooksonline.com/book/programming/cplusplus/9780321545183/associative-containers/ch03lev1sec6

hedgezzz 發表在 痞客邦 留言(0) 人氣()

alloca allocate memory on stack , 有以下優點 :

• There is very little overhead to the allocation process because the microprocessor

hedgezzz 發表在 痞客邦 留言(0) 人氣()

class student
{

hedgezzz 發表在 痞客邦 留言(0) 人氣()

struct People_
{

hedgezzz 發表在 痞客邦 留言(1) 人氣()

#include <stdio.h>
#include <stdbool.h>

hedgezzz 發表在 痞客邦 留言(0) 人氣()