| 233 | /// \return a new shared_ptr<Buffer> |
| 234 | template <typename T, typename SizeType = int64_t> |
| 235 | static std::shared_ptr<Buffer> Wrap(const T* data, SizeType length) { |
| 236 | return std::make_shared<Buffer>(reinterpret_cast<const uint8_t*>(data), |
| 237 | static_cast<int64_t>(sizeof(T) * length)); |
| 238 | } |
| 239 | |
| 240 | /// \brief Create buffer referencing std::vector with some length without |
| 241 | /// copying |