7
4

2 に答える 2

16

アロケータは4番目のテンプレートパラメータであるのに対し、3番目のパラメータはコンパレータのようにstd::less?うまくいくstd::map<int, int, std::less<int>, Allocator< std::pair<const int, int> > >はずです。

また、デフォルトのctorを追加してctorをコピーする必要があると思います。

  Allocator() {}

  template<class Other>
  Allocator( const Allocator<Other>& _Right ) {}
于 2011-06-09T16:48:10.297 に答える