I have made a class for storing the information of visitied arena. I run that class separtate on ubuntu it compiles and run successfully.
But when I am trying to add this new class in my existing code of Argos2. But i get error when i use the 'make' command to compile all files.
Code of class is given below:
Code: Select all
#include <iostream>
class CCI_Point
{
private:
double x;
double y;
public:
CCI_Point()
{
x = 0.0;
y = 0.0;
}
CCI_Point (double x, double y)
{
this->x = x;
this->y = y;
}
bool operator==(const CCI_Point &that) const
{
return (x == that.x && y == that.y);
}
double getX() const
{
return this->x;
}
double getY() const
{
return this->y;
}
};
namespace std
{
template <> class std::hash<CCI_Point>
{
public:
inline size_t operator()(const CCI_Point &p) const
{
hash<double> double_hasher;
return double_hasher(p.getX()) ^ double_hasher(p.getY());
}
};
};
Code: Select all
In file included from /home/waqar/argos2-examples/controllers/distance_scannar/distance_scannar.h:26:0,
from /home/waqar/argos2-examples/controllers/distance_scannar/distance_scannar.cpp:1:
/usr/include/argos2/common/control_interface/ci_point.h:36:25: error: ‘hash’ is not a class template
template <> class std::hash<CCI_Point>
^
/usr/include/argos2/common/control_interface/ci_point.h:37:2: error: qualified name does not name a class before ‘{’ token
{
^