[討論] 丟上去uva compler error

看板C_and_CPP作者 (阿德)時間11年前 (2015/02/13 04:16), 編輯推噓0(003)
留言3則, 3人參與, 最新討論串1/1
請問一下這個錯誤訊息 是甚麼問題 我在微軟的compler上complier是 ok 但是我丟上uva 網站上 卻是complier error 是為什麼 usr/include/c++/4.9.1/bits/stl_tree.h:1277:6: error: passing †string &k2) { //return k1.length() < k2.length(); i 片段程式碼如下 應該是這段compler error struct CmpByKeyLength { bool operator()(const string &k1, const string &k2) { //return k1.length() < k2.length(); if(strcmp(k1.c_str(),k2.c_str())<0) return true; if(strcmp(k1.c_str(),k2.c_str())==0) return true; return false; } }; map <string,int,CmpByKeyLength> my_map; -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.167.152.91 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1423772218.A.EE3.html

02/13 10:26, , 1F
我用vc2013跟gcc-4.9.2 兩個都沒問題
02/13 10:26, 1F

02/13 11:34, , 2F
印象uva不能有註解
02/13 11:34, 2F

02/13 11:54, , 3F
改成 bool operator()(....) const { ... 呢
02/13 11:54, 3F
文章代碼(AID): #1KtGewxZ (C_and_CPP)