Disallow copy and assign for DataBuilder & RandomGenerator

BUG=tint:1247

Change-Id: I48f7b1e1679bcba43e4c284b2f97a02210feabb3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66740
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Ryan Harrison
2021-10-18 18:46:57 +00:00
committed by Tint LUCI CQ
parent 8045166b16
commit 5f5d43ff51
2 changed files with 13 additions and 1 deletions

View File

@@ -34,7 +34,8 @@ class DataBuilder {
explicit DataBuilder(const uint8_t* data, size_t size)
: generator_(data, size) {}
~DataBuilder() {}
~DataBuilder() = default;
DataBuilder(DataBuilder&&) = default;
/// Generate pseudo-random data of a specific type
/// @tparam T - type of data to produce
@@ -85,6 +86,10 @@ class DataBuilder {
private:
RandomGenerator generator_;
// Disallow copy & assign
DataBuilder(const DataBuilder&) = delete;
DataBuilder& operator=(const DataBuilder&) = delete;
/// Get N bytes of pseudo-random data
/// @param out - pointer to location to save data
/// @param n - number of bytes to get