作者sion0814 ((≧﹏≦))
看板EE_DSnP
标题Re: [HW] HW3成绩更新
时间Fri Jan 14 20:10:51 2011
因为有几个同学有同样的情况,就直接po在板上。
有同学反应程式在自己电脑可以编译,不过却没有分数并被标记以下的compile error:
no matching function for call to 'std::
pair<std::string&, CmdExec*>::pair(~~~)
我google了一下,找到了相关的问题
http://stackoverflow.com/questions/3769781/stdpair-of-references
No, you cannot do this reliably in C++03, because the constructor of pair takes
references to T, and
creating a reference to a reference is not legal in C++03.
Notice that I said "reliably". Some common compilers still in use do not allow
forming a reference to a reference, but
more recently do allow it as they
implement reference collapsing (T& is T if T is a reference type). If your code
uses such things, you cannot rely on it to work on other compilers until you
try it and see.
因为惯用的所上Server的compiler版本gcc version 4.2.4,的确不允许这样使用,
我试着用gcc version 4.4.4,则就编译成功了。
故部分同学的分数已补回了。
不过因为
基本上还是希望同学写的程式是
可以在一般平台上都能顺利编译(portability?)并正确运作(reliability?)的,
所以在Compile部分还是会酌扣一点分数!
===成绩更新===
bxxxx2x07 299
bxxxx2x22 105
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.24.232
※ 编辑: sion0814 来自: 140.112.24.232 (01/14 20:12)
1F:推 tomap41017:请问助教这次作业可以使用tr1/functional吗? 01/15 13:54