use std::array functions for pointer and size of data

This commit is contained in:
Tyler Galdes
2018-11-19 11:49:17 -05:00
parent 757d2b623f
commit b48036fe62

View File

@@ -99,7 +99,7 @@ public:
*/
template <typename T, size_t N>
Buffer(const std::array<T, N>& data)
: data_(reinterpret_cast<const DataType*>(&data[0])), size_(N * sizeof(T)) {
: data_(reinterpret_cast<const DataType*>(data.data())), size_(data.size()) {
static_assert(sizeof(T) == sizeof(DataType), "sizeof(T) != sizeof(DataType)");
}