看板 EE_DSnP 關於我們 聯絡資訊
假設現在我寫一個 function 在 function scope 裡面需要用到很多次iterator this->end() 第一種寫法:先令一個local variable 例如: iterator it_end = this->end(); 之後每次要用到時就用 it_end 第二種寫法:每次要用到時都用 this->end() 以我的想法 一定是第一種寫法執行較快 但是若我們寫第二種寫法 compiler會幫我們處理成如第一種的執行方式嗎 寫到一半想到此問題 想釐清一下... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 219.91.88.19