Set shared_ptr with new_pointer that is old_pointer + offset
Yes this is possible. You can use constructor 8, the aliasing constructor from this reference: https://en.cppreference.com/w/cpp/memory/shared_ptr/shared_ptr // make sure you use an array deleter std::shared_ptr<char> osp(new char[1024], std::default_delete<char[]>()); // load the data into your buffer at osp.get() // Find the offset in the data by parsing auto const offset = parse_buffer_for_offset(osp.get()); // Now set a … Read more