Add more tests to producer

This commit is contained in:
Matias Fontanini
2016-05-23 21:03:34 -07:00
parent 4475209ce1
commit 6374062f47
3 changed files with 88 additions and 22 deletions

View File

@@ -11,10 +11,10 @@ public:
using DataType = unsigned char;
Buffer();
Buffer(const DataType* data, size_t size);
template <typename ForwardIterator>
Buffer(const ForwardIterator& start, const ForwardIterator& end) :
data_((const DataType*)&*start), size_(std::distance(start, end)) {
template <typename T>
Buffer(const T* data, size_t size)
: data_(reinterpret_cast<const DataType*>(data)), size_(size) {
static_assert(sizeof(T) == 1, "Buffer must point to elements of 1 byte");
}