開發平台(Platform): (Ex: Win10, Linux, ...)
Linux
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
GCC
問題(Question):
請問m4這個lamda初始化Cmp是什麼語法??
在書上看到這段code可是沒解釋這段的寫法,這個就我的理解,
好像也不是List initialization ?
可以不管前面兩個參數直接匹配到Cmp??
程式碼(Code):(請善用置底文網頁, 記得排版,禁止使用圖檔)
// g++ std-map.cpp -o a.out -std=c++11
#include <iostream>
#include <string>
#include <map>
using namespace std;
using Cmp = bool(*)(const int&,const int&);
int main() {
map<int,int,Cmp> m4{[](const int &a,const int &b){return a>b;}};
return 0;
}
感謝