지도의지도에 맞춤 할당자를 사용할 수있는 방법이 있습니까?지도 및 맞춤 할당 자의지도
typedef std::map<int,int> Inner;
typedef std::map<int, Inner> Outer;
내가 모두 사용자 정의 할당을 가질 수
즉이의 내가 있다고 가정 해 봅시다?
내부 맵의 생성자에서 내부 맵의 할당자를 정의 할 수 없으므로 어떻게 할 수 있습니까? 외부에 대한
즉 내가 할 것이다 : 내부를 들어
Allocator myAllocator;
Outer outer(std::less<int>(), myAllocatorObject);
을 ??
외부'map'에 대한 할당자를 작성할 수 없습니다. 여기서'construct'는 할당자를 내부 'map's에 지정합니다. (개인적으로 시도한 적은 없지만 유망한 전망 임). –
잘 모름. 예? –
이 데모는 설명하는 것과 매우 유사합니다 (따라서 실제로 boost를 사용하지 않더라도 원리를 보여줍니다) : http://www.boost.org/doc/libs/1_57_0/doc/ html/interprocess/allocators_containers.html # interprocess.allocators_containers.containers_explained.containers_of_containers – jez