| 186 | /// \return a new shared_ptr<Buffer> |
| 187 | template <typename T, typename SizeType = int64_t> |
| 188 | static std::shared_ptr<Buffer> Wrap(const T* data, SizeType length) { |
| 189 | return std::make_shared<Buffer>(reinterpret_cast<const uint8_t*>(data), |
| 190 | static_cast<int64_t>(sizeof(T) * length)); |
| 191 | } |
| 192 | |
| 193 | /// \brief Create buffer referencing std::vector with some length without |
| 194 | /// copying |