mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-02 19:47:55 +00:00
use std::array functions for pointer and size of data
This commit is contained in:
@@ -99,7 +99,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
template <typename T, size_t N>
|
template <typename T, size_t N>
|
||||||
Buffer(const std::array<T, N>& data)
|
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)");
|
static_assert(sizeof(T) == sizeof(DataType), "sizeof(T) != sizeof(DataType)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user