Visual C++ Team Blog にアロケータが紹介されてたよ。
アロケータ作りたい人は参考にどうぞ。
Visual C++ Team Blog -The Mallocator-
これに加えてビルトイン型用にアロケータ用意するといいね。
こんな感じ。(template の<> がタグに認識される orz
# 20080904 class が消えていたのを修正、タグが消えるのが直った!!
-
// 間違い
-
// template <T> class AllocatorBuiltin : public Mallocator<T> {};
-
// 正しい
-
template <class T> class AllocatorBuiltin : public Mallocator<T> {};
-
-
// 間違い
-
// template <T> class Allocator : public Mallocator<T> {};
-
// 正しい
-
template <class T> class Allocator : public Mallocator<T> {};
-
template <> class Allocator<int> : public AllocatorBuiltin <int> {};
-
// 以下好きなだけ
