\brief copy from \param vec the vector
| 392 | /// \brief copy from |
| 393 | /// \param vec the vector |
| 394 | void copy_from(const std::vector<T>& vec) { |
| 395 | if (vec.size() * sizeof(T) != this->size_) { |
| 396 | throw std::runtime_error("Size mismatch in copy_from(vector)"); |
| 397 | } |
| 398 | std::memcpy(data_, vec.data(), size_); |
| 399 | } |
| 400 | |
| 401 | /// \brief cast to another type |
| 402 | /// \tparam U the type |