已定义方法 (在btw类中),但是编译器(gcc 6.3)仍然说不是:
template<OperatorId op>
class ChangeTypeExpression : public UnaryExpression {
public:
/* Ctor here... */
// The compiler complains about the destructor
virtual ~ChangeTypeExpression() {}
// ... and it doesn't like this method too
virtual string ToString(bool verbose) const {
return ...;
}
// ...
// Maybe relevant - I already don't know...
DISALLOW_COPY_AND_ASSIGN(ChangeTypeExpression);
};
编译器输出如下:
[ 24%] Building CXX object src/engine/executor/CMakeFiles/supersonic.dir/expression/core/regexp_expressions.cc.o
/home/asg/work/raijin/src/engine/executor/expression/core/elementary_expressions.cc:61:11: warning: ‘supersonic::{anonymous}::ChangeTypeExpression<op>::~ChangeTypeExpression() noexcept [with supersonic::OperatorId op = (supersonic::OperatorId)265u]’ declared ‘static’ but never defined [-Wunused-function]
virtual ~ChangeTypeExpression() {}
^
/home/asg/work/raijin/src/engine/executor/expression/core/elementary_expressions.cc:67:18: warning: ‘std::__cxx11::string supersonic::{anonymous}::ChangeTypeExpression<op>::ToString(bool) const [with supersonic::OperatorId op = (supersonic::OperatorId)265u]’ declared ‘static’ but never defined [-Wunused-function]
virtual string ToString(bool verbose) const {
^~~~~~~~
可以找到原始代码here,请注意,这不是我的代码-Google的人已经编写了它。我没想到为什么会发生这种情况,有人知道答案吗?