Guest User

Untitled

a guest
Jun 25th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. class base
  2. {
  3. public:
  4. base():size(), p_array(0){}
  5. private:
  6. size_t size;
  7. boost::shared_array<unsigned char> p_array;
  8.  
  9. };
  10.  
  11. class derived
  12. {
  13. public:
  14. derived(size_t array_size):size(array_size)
  15. {
  16. p_array.reset(new unsigned char[size]);
  17. }
  18. };
  19.  
  20. p_array.reset(new unsigned char[size]);
  21.  
  22. class base
  23. {
  24. public:
  25. base():size(), p_array(0){}
  26. base(size_t array_size):size(array_size)
  27. {
  28. p_array.reset(new unsigned char[size]);
  29. }
  30. private:
  31. size_t size;
  32. boost::shared_ptr<unsigned char> p_array;
  33.  
  34. };
  35.  
  36. class derived
  37. {
  38. public:
  39. derived(size_t array_size):base(array_size)
  40. {
  41. }
  42. private:
  43. };
  44.  
  45. class base
  46. {
  47. base(size_):size(size_), p_array(new char[size_]) {}
  48. }
  49.  
  50. class largebufferderived : public base
  51. {
  52. public:
  53. largebufferderived() : base(77220) {}
  54. }
  55.  
  56. boost::shared_ptr<char> Buffer()
  57. {
  58. if (!p_Array)
  59. p_array.reset(new unsigned char[size]);
  60. }
Add Comment
Please, Sign In to add comment