Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. template<class T>
  2. class allocator
  3. {
  4. ...
  5. template<class Other>
  6. struct rebind { typedef allocator<Other> other; };
  7. };
  8.  
  9. template<class T, class Alloc = std::allocator<T> >
  10. class vector { ... };
  11.  
  12. template<class T>
  13. class allocator { ... };
  14.  
  15. template<class T, template<class> class Alloc = std::allocator>
  16. class vector { ... };
  17.  
  18. template<unsigned int PoolSize>
  19. struct pool
  20. {
  21. template<class T>
  22. struct allocator
  23. {
  24. T pool[PoolSize];
  25.  
  26. ...
  27. };
  28. };
  29.  
  30. template<class T, template<class> class Alloc>
  31. class vector { ... };
  32.  
  33. typedef vector<int, pool<1>::allocator> int_vector;
  34.  
  35. std::vector<T, my_allocator<T,Arg2> > v1;
  36.  
  37. std::vector<T, my_allocator_wrapper<Arg2>::template type > v2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement