compailing problem
i cant understand what the problem with my code
header file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
#ifndef ROBOTDB_H
#define ROBOTDB_H
#include <iostream>
#include <string>
#include <vector>
#include "Robot.h"
#include "Map.h"
typedef std::vector<Robot*> RobotVec;
typedef std::vector<Robot*>::iterator RobotVec_it;
typedef std::vector<Robot*>::const_iterator RobotVec_cit;
std::vector<Robot> robotvec;
class RobotDB
{
private:
Map *map;
RobotVec robots;
public:
RobotDB(Map *new_map):map(new_map){};
~RobotDB(){};
void Move();
void MoveMulti();
void Place();
void AddWall();
void Delete();
};
#endif
|
cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#include "RobotDB.h"
#include <iostream>
#include <vector>
#include <string>
using namespace std;
void RobotDB::Place(){
string robname;
size_type namelangth,x,y;
cin>>robname>>x>>y;
namelangth=robname.size();
if(namelangth!=3){return;}
bool placecheck=(*map).check(x,y);
if(placecheck){
Coordinate newcoordinate(x,y);
Robot newrobot1(newcoordinate,robname);
robotvec.push_back (newrobot1);
}
}
|
instantiated from `void std::vector<_Tp, _Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<typename _Alloc::pointer, std::vector<_Tp, _Alloc> >, const _Tp&) [with _Tp = Robot, _Alloc = std::allocator<Robot>]'
thanks
Topic archived. No new replies allowed.