記錄一些c++不常用功能點和一些c++的坑點,備查
q.c++ using 關鍵字應用:
private 繼承時,使用using關鍵字在繼承類中修改基類public成員的預設訪問型別;
栗子:
classbase
int base_memeber = 1
;private:};
class inherit : private
base
;
q.c++ static 關鍵字應用:
函式中可以使用static關鍵字 定義靜態變數,其作用範圍只在其函式體中有效.
栗子:
intbasemethod()
q. c++ template ... 與decltype ():
#include #include"string
"using
namespace
std;
template
void func_one(t&val)
//不可用
template< typename t, typename... args>auto func_two(
int index, t& val, const args&... args) ->decltype(t)
else
}template
void func_one(t& val, const args&... args)
void func_test(double d, int i, string
str)
intmain()
2017 9 17 相關分析 思考記錄
想不明白考場上怎麼爆零了 可能太自信了 基本用初中的數學就可以把式子化成要維護的東西,x 2,x y,x,y 然後就計算就行了 注意 迴圈變數作為取值需要long long 不要太自信 不對拍就不要交 碼 include includeusing namespace std define zuo o...
ns3相關記錄
2.ofswitch13 for ns3 二.執行 1.列印所有模組下的log日誌。1 在終端輸入 export ns log level all 2 在終端輸入執行語句 waf run scratch wzx mptcp logsdn all.out 注意 前面不能加 sudo 命令 3 waf ...
PyQt5相關筆記
顯示 triggered self.show self.quit action qtwidgets.qaction 退出 self.tray menu.addaction self.show action self.tray menu.addaction self.quit action self....