📄 mynode_imp.cpp
字号:
#include "stdafx.h"
#include "mynode.h"
Node::Node(const string& name):expression_(name),is_const_(false),value_(0)
{}
Node::Node(double c):value_(c),is_const_(true),expression_("")
{
//cout<<"c->Node called\n";
}
Node::Node(const Operand& o)
:value_(o.GetSingleValue()),expression_(o.GetExpression()),is_const_(o.IsConst())
{}
Node::~Node()
{}
bool Node::operator<(const Node& in)const
{
/* if (IsConst()) // i am a const
{
if (in.IsConst())
return GetResult() < in.GetResult();
// c - c
else
return true;
//c - f
}
else // i am factor
{
if (!in.IsConst())
return GetExpression() < in.GetExpression();
// f - f
else
return false;
// f - c
}*/
return expression_ < in.expression_;
//认为所有的常数是相等的
//居然在这里出现了bug!!!!!!!!!!!
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -