http://www.cppblog.com/cppblogs/archive/2012/09/06/189749.html 今天写了一段小代码,本以为正确,但运行后,就somehow ”discard qualifier“于是猛百度,google之,找到答案,可惜正解为英语,冗长之,自己翻译半天,终于弄明白~这里是原程序:#include<iostream> using namespace std; class Date { int year; public: …
示例程序: #include <iostream> #include <set> using namespace std ; class StudentT { public : int id ; string name ; public : StudentT ( int _id , string _name ) : id ( _id ), name ( _name ) { } int getId () { return id ; …
百思不得其解,于是百度,google吧.. 发现Stackoverflow上也有人有相同的问题 下面是他的问题: For my compsci class, I am implementing a Stack template class, but have run into an odd error: Stack.h: In member function 'const T Stack<T>::top() const [with T = int]': Stack.cpp:10: error:…