blob: 148dc54c971290800e5bd2c74240010c6e5af22a [file] [log] [blame]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <cstdint>
#include <vector>
namespace forensics {
// Move-only specialization of std::vector that can be used in place of std::vector when
// the data in the underlying buffer is copyable, but copying it is undesirable, e.g. the vector
// holds a large amount of data.
class SizedData : public std::vector<uint8_t> {
// Inherit the constructors of std::vector.
using std::vector<uint8_t>::vector;
// Delete copy constructors.
SizedData(const SizedData& other) = delete;
SizedData& operator=(const SizedData& other) = delete;
// Define move constructors as defaults.
SizedData(SizedData&& other) = default;
SizedData& operator=(SizedData&& other) = default;
} // namespace forensics