摘要:
//头文件省略 struct Edge { int from, to, val; Edge(int f = 0, int t = 0, int v = 0) : from(f), to(t), val(v) {} }; struct Graph { vector<vector<int>> graph 阅读全文
摘要:
auto推导类型忽略顶层const,不忽略底层const。 顶层const:指针或引用本身是const不可变,也就是指针指向的内存地址不可变,但指向的内存内容可变。 底层const:指针指向的内存地址可变,但指向内存的内容不可变。 const int a = 10; auto x = a; //x是 阅读全文