Delete construction of buffer with rvalue arrays

This commit is contained in:
Tyler Galdes
2018-11-19 19:48:02 -05:00
parent b48036fe62
commit 248d1b0638

View File

@@ -92,6 +92,10 @@ public:
static_assert(sizeof(T) == sizeof(DataType), "sizeof(T) != sizeof(DataType)");
}
// Don't allow construction from temporary vectors
template <typename T>
Buffer(std::vector<T>&& data) = delete;
/**
* Constructs a buffer from an array
*
@@ -103,9 +107,9 @@ public:
static_assert(sizeof(T) == sizeof(DataType), "sizeof(T) != sizeof(DataType)");
}
// Don't allow construction from temporary vectors
template <typename T>
Buffer(std::vector<T>&& data) = delete;
// Don't allow construction from temporary arrays
template <typename T, size_t N>
Buffer(std::array<T, N>&& data) = delete;
/**
* \brief Construct a buffer from a const string ref