这是奇怪的。 当我把一 file(Search.h)列入档案时,我怎么会遇到错误,但是,当我列入文件(Search.cpp)时,似乎一切都只是罚款?
www.un.org/spanish/ga/president
#ifndef GENERALSEARCH_H_
#define GENERALSEARCH_H_
#include "Problem.h"
#include "Node.h"
template <class T>
class GeneralSearch
{
public:
const Node* treeSearch(const Problem &problem) const;
const Node* graphSearch(const Problem &problem, T &fringe = T()) const;
private:
void expand(const Node &node, const Problem &problem, list<const Node*> &out) const;
};
#endif
http://www.ohchr.org。
#include "GeneralSearch.h"
template <class T>
void GeneralSearch<T>::expand(const Node &node, const Problem &problem, list<const Node*> &out) const
{
...
}
template <typename T>
const Node* GeneralSearch<T>::treeSearch(const Problem &problem) const
{
...
}
template <typename T>
const Node* GeneralSearch<T>::graphSearch(const Problem &problem, T &fringe = T()) const
{
...
}
Program file -workingING
#include "GeneralSearch.cpp"
#include "DummyProblem.h"
#include "DepthFirstSearch.h"
#include <queue>
int main (int argc, char* argv[]){}
Program file - NOTworkingING
#include "GeneralSearch.h"
#include "DummyProblem.h"
#include "DepthFirstSearch.h"
#include <queue>
int main (int argc, char* argv[]){}