ポイントマップにポイントのベクトルを設定しようとしています。ボード上の各位置にポイント (x、y) と正当な動きのベクトル (ポイント オブジェクト) があるボード ゲームを作成しようとしています。
マップ KEY をポイントとして持つことができないようです。
struct Point
{
Point() {}
Point(int ix, int iy ) :x(ix), y(iy) {}
int x;
int y;
};
Point p_source (2,2);
Point p_next1 (1,2);
Point p_next2 (1,3);
Point p_next3 (1,4);
map <Point, vector<Point> > m_point;
dict[p_source].push_back(p_next1);
dict[p_source].push_back(p_next2);
dict[p_source].push_back(p_next3);
これは私が得るエラーです
メンバー関数内 'bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = Point]':|
'_Tp& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const _Key&) [ with _Key = Point, _Tp = std::vector, std::allocator >, std::allocator, std::アロケーター > > >、_Compare = std::less、_Alloc = std::アロケーター、std::アロケーター >、std::アロケーター、|
ここからインスタンス化|
c:\program files ('operator<' in '__x < __y'| ||=== ビルド終了: 1 エラー、0 警告 ===|