1.在Chap3 3.11 Advice p.66 裡 第七條
Using string rather than char*
請問即使我對char * 用了簡單的strcat strcpy這些library
會比string 還要來的慢嗎???
或者是可以說明在處理字串時(就ascii就好了)
什麼時候用string,when to use char*呢?
2.在10.2.8 Structurs and Classes的最後 p.235
他講了一句
allowing many access sepcifiers in a class is useful for
machine generated code.
就是他上面有講個例子 public,private可以一直加的
class Data4 {
public :
...
private :
...
public:
...
}
這裡的machine generated code是指什麼?
是某些tool產生出的c++ code還是compile完產生的code
(IR, assembly, or machine code)
為什麼會useful??
3. 在10.4.6.2 Member Constants p249
他說可以initialize a static integral constant member
為什麼只有int 可以 float那些為什麼不行呢???
4.在11.2.3 p265
第一段要結束時他說
it is not possible to define an operator function that
operates exclusively on pointers
5.Sec13.4 Using Template Arguments to Specify Policy
主要在講用Template class來specify operation(less,eq,..)
在p339 倒數第三段最後面 他說了
whereas inlining a call through a pointer to function
requires exceptional attention from a compiler
在這裡指的exceptional attention是指什麼呢?
寫C寫久了會很習慣用pointer to function
但想知道這裡不建議使用pfn的原因
6. Sec14.2 Grouping of Exceptions
第一段的第三行有說
the effect of a throw is to unwind the stack until a
suitable catch is found
他說的unwind是什麼意思呢
是指一般function return時stack會清掉的意思嗎?
(esp回到ebp)
如果是這樣的話
throw 出來的那個object(or pointer,reference)
他是存在哪裡的??
stack被清掉那exception應該也會被清吧???