Guest User

Untitled

a guest
Feb 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. class chunk_t
  2. {
  3. public:
  4. explicit chunk_t();
  5.  
  6. ~chunk_t();
  7.  
  8. static chunk_t create_from(const roaring_bitmap_t &data, bool filled = false);
  9.  
  10. private:
  11. bool filled = false;
  12. roaring_bitmap_t *data = nullptr;
  13.  
  14. explicit chunk_t(const chunk_t &other);
  15. };
  16.  
  17. chunk_t::chunk_t()
  18. {
  19. this->data = roaring_bitmap_create_with_capacity(C);
  20. }
  21.  
  22. chunk_t::chunk_t(const chunk_t &other)
  23. {
  24. _ASSERT(other.data != nullptr);
  25.  
  26. this->data = roaring_bitmap_copy(other.data);
  27. this->filled = other.filled;
  28. }
  29.  
  30. chunk_t chunk_t::create_from(const roaring_bitmap_t &data, bool filled)
  31. {
  32. chunk_t c;
  33. c.data = roaring_bitmap_copy(&data);
  34. c.filled = filled;
  35. return c; // ERROR: class `chunk_t` has no suitable copy constructor
  36. }
  37.  
  38. chunk_t::~chunk_t()
  39. {
  40. if(this->data != nullptr)
  41. {
  42. roaring_bitmap_free(this->data);
  43. this->data = nullptr;
  44. }
  45. }
Add Comment
Please, Sign In to add comment