| 185 | BufferType buffer; |
| 186 | |
| 187 | ControlBlock(T container, int64_t nbytes, Func&& get_data) |
| 188 | : container(std::move(container)), |
| 189 | // Read the data pointer only once the container has reached its final |
| 190 | // address, since moving it may invalidate the pointer (e.g. in a small |
| 191 | // string optimization). |
| 192 | buffer(reinterpret_cast<Byte*>(std::forward<Func>(get_data)(this->container)), |
| 193 | nbytes) {} |
| 194 | }; |
| 195 | |
| 196 | auto owner = std::make_shared<ControlBlock>(std::move(container), nbytes, |
nothing calls this directly
no outgoing calls
no test coverage detected