Advertisement
Guest User

Untitled

a guest
Mar 12th, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1.   gap_buffer::gap_buffer() :
  2.   buffer(malloc(char_type[alloc_size] * sizeof(char_type), std::free)
  3.   buffer_size(alloc_size),
  4.   lptr(lptr_beg()), rptr(rptr_beg()),
  5.   staging_lptr(lptr), staging_rptr(rptr),
  6.   character_num(0),
  7.   codepoint_num(0) {
  8.   }
  9.  
  10.   gap_buffer::gap_buffer(const gap_buffer& other) :
  11.   buffer(malloc(char_type[other.buffer_size] * sizeof(char_type)), std::free),
  12.   lptr(other.lptr), rptr(other.rptr),
  13.   staging_lptr(other.staging_lptr), staging_rptr(other.staging_rptr),
  14.   buffer_size(other.buffer_size),
  15.   character_num(other.character_num),
  16.   codepoint_num(other.codepoint_num),
  17.   lines(other.lines) {
  18.     std::memcpy(lptr_beg(), other.lptr_beg(), lsize());
  19.     std::memcpy(rptr, other.rptr, rsize());
  20.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement