fork download
  1. #include <iostream>
  2. #include <type_traits>
  3. using namespace std;
  4.  
  5.  
  6.  
  7. template<typename T>
  8. struct Allocator
  9. {
  10. typedef T value_type;
  11.  
  12. Allocator() noexcept {};
  13.  
  14. template<typename U>
  15. Allocator(const Allocator<U>& other) throw() {};
  16.  
  17. T* allocate(std::size_t n, const void* hint = 0)
  18. {
  19. return static_cast<T*>(::operator new(n * sizeof(T)));
  20. }
  21.  
  22. void deallocate(T* ptr, std::size_t n)
  23. {
  24. ::operator delete(ptr);
  25. }
  26. };
  27.  
  28. template <typename T, typename U>
  29. inline bool operator == (const Allocator<T>&, const Allocator<U>&)
  30. {
  31. return true;
  32. }
  33.  
  34. template <typename T, typename U>
  35. inline bool operator != (const Allocator<T>& a, const Allocator<U>& b)
  36. {
  37. return !(a == b);
  38. }
  39.  
  40.  
  41.  
  42. int main() {
  43. // your code goes here
  44. return 0;
  45. }
Success #stdin #stdout 0s 4372KB
stdin
Standard input is empty
stdout
Standard output is empty