Just do what the teacher said you shouldn't and derive the buffer_t from std::vector<uint8_t> instead of reinventing all the bullshit entailed.
Added hash functions and renamed buffer_t::data_ptr() to buffer_t::getptr() to be consistent with strings.