Advertisement
wowonline

Untitled

Apr 7th, 2022
624
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <cstdio>
  2. #include <iostream>
  3.  
  4.  
  5. struct Item
  6. {
  7.     Item *next;
  8.     long long value;
  9. };
  10.  
  11. class Arena {
  12. public:
  13.     Arena(const Arena&) = delete;
  14.     Arena &operator=(Arena other) = delete;
  15.  
  16.     Item *arr;
  17.     bool *arr_vacant;
  18.  
  19.     explicit Arena(size_t size) {
  20.         Item *arr = new Item[size];
  21.         bool *arr_vacant = new bool[size];
  22.  
  23.         for (int i = 0; i < size; ++i) {
  24.             arr_vacant[i] = false;
  25.         }
  26.  
  27.         std::cout<<sizeof(arr);
  28.     }
  29.  
  30.     // ~Arena() {
  31.     //     delete arr;
  32.     //     delete arr_vacant;
  33.     // }
  34.  
  35.     Item *get();
  36.  
  37.  
  38.     void put(Item *);
  39.  
  40. };
  41.  
  42.  
  43. int main()
  44. {
  45.     Arena t(10);
  46. }
Advertisement
RAW Paste Data Copied
Advertisement